coverup

Tabs

Switch between panels. The selected tab takes the accent.

Tabs

Wire each tab to its panel with aria-controls. coverup.js handles the switching.

Your public profile and avatar.
<div>
  <div class="tabs" role="tablist">
    <button class="tab" role="tab" id="t-profile" aria-controls="p-profile" aria-selected="true">Profile</button>
    <button class="tab" role="tab" id="t-billing" aria-controls="p-billing" aria-selected="false" tabindex="-1">Billing</button>
    <button class="tab" role="tab" id="t-team" aria-controls="p-team" aria-selected="false" tabindex="-1">Team</button>
  </div>
  <div class="tab-panel" id="p-profile" role="tabpanel" aria-labelledby="t-profile">Your public profile and avatar.</div>
  <div class="tab-panel" id="p-billing" role="tabpanel" aria-labelledby="t-billing" hidden>Invoices and payment methods.</div>
  <div class="tab-panel" id="p-team" role="tabpanel" aria-labelledby="t-team" hidden>Members and roles.</div>
</div>

Classes

SelectorPurpose
.tabs[role=tablist]The row
.tab[role=tab]A tab; aria-selected marks the current one
.tab-panel[role=tabpanel]Content; hidden when not selected