Tabs
Tabs come in 2 variations
1. Link Tabs
These tabs are links to other pages, so they need no JavaScript — the browser supplies focus, Enter, and back-button behaviour. Mark the current page with aria-current="page".
Example Code
<nav class="tab">
<ul>
<li><a href="#">Introduction</a></li>
<li class='active' aria-current="page"><a href="#">Get Started</a></li>
<li><a href="#">Tutorials</a></li>
<li><a href="#">Changelog</a></li>
</ul>
</nav>
2. Radio Tabs
This variant switches content without JavaScript by pairing a radio group with its labels. The radios stay in the tab order, so Tab reaches the group and the arrow keys change the selected tab; the focus ring is drawn on the label. Building a tab component with Pure CSS using Radio and Label Tags
Example Code
<nav class="tab tab-radio">
<input type="radio" name="tab" id="tab1" checked />
<label for="tab1">Introduction</label>
<section>
<h3>Introduction Content</h3>
<p>
Introduction Features: radio groups are announced as a set, so a screen reader user
hears how many options exist and which one is selected.
</p>
</section>
<input type="radio" name="tab" id="tab2" />
<label for="tab2">Get Started</label>
<section>
<h3>Get Started Content</h3>
<p>
Get started Features: only the selected panel is rendered visible, and no panel state
is left to a CSS class the user cannot reach.
</p>
</section>
<input type="radio" name="tab" id="tab3" />
<label for="tab3">Tutorials</label>
<section>
<h3>Tutorials Content</h3>
<p>
Tutorials Features: each label is a real target, at least as wide as its text,
so the tap area is not limited to the glyph.
</p>
</section>
<input type="radio" name="tab" id="tab4" />
<label for="tab4">Changelog</label>
<section>
<h3>Changelog Content</h3>
<p>
Changelog Features: no JavaScript, no hidden focus stop, and the whole component
degrades to a plain radio group with the stylesheet removed.
</p>
</section>
</nav>