fin1te/dsv1.0.0
  1. ds
  2. Components
  3. Tabs

Tabs

Canvas tabs from topo and an underlined variant.

Canvas tabs

Code
<div class="island">
  <div class="tabs" role="tablist" aria-label="Canvases">
    <div class="tab on" role="tab" aria-selected="true" tabindex="0">
      <span>Checkout</span>
      <button class="tx" aria-label="Close"><svg class="i">…</svg></button>
    </div>
    …
  </div>
</div>

From topo's bottom bar. The close button shows on hover and on the selected tab.

Underlined

The rendered component.

API

ClassOnWhat it does
.tabsdiv[role=tablist]A row of tabs that scrolls sideways when full.
.tabbutton, div[role=tab]One tab.
aria-selected="true" / .on.tabThe current tab.
.txbuttonClose button inside a tab.
.line.tabsUnderlined variant for page sections.

Accessibility

  • Only the selected tab is in the tab order (tabindex="0"); arrow keys move between tabs.
  • Each tab points at its panel with aria-controls.