Tabs

Route tabs and accessible interactive tab panels with DuskMoonUI styling

Tabs

Tabs provide presentation only. DuskMoonUI owns layout, states, focus, and panel visibility; the browser owns link navigation; your application owns interactive selection and ARIA relationships. Core has no required JavaScript runtime.

Route navigation

Use links and aria-current="page" when every tab is a route. Do not add tab roles or intercept arrow keys for ordinary site navigation.

Route tabs

Interactive panels

This page uses automatic activation: clicking or moving with an arrow selects a tab immediately. Home and End select the first and last enabled tab. Horizontal lists use Left/Right and respect text direction; vertical lists use Up/Down. Disabled tabs are skipped. IDs are instance-specific.

Interactive tabs

Project overview. Interactive descendants remain reachable.

Inactive panels use hidden, removing descendants from normal keyboard navigation. hidden always wins over a stale .tab-panel-show class. Update hidden, aria-selected, and roving tabindex together.

Appearances

Underline, pill, tonal, boxed, and lifted

Color and content

Color, icon, badge, and icon-only tabs

The active color classes are .tab-active-primary (default), .tab-active-secondary, and .tab-active-tertiary. aria-selected="true" uses the primary treatment unless an explicit color class is present.

Layout and size

Vertical tabs

  • .tabs-scrollable keeps a long list on one line and allows horizontal scrolling.
  • .tabs-full gives items equal width; .tabs-center and .tabs-end align a list.
  • .tabs-sm, .tabs-md, and .tabs-lg size every item.
  • Legacy item selectors .tab-xs, .tab-sm, and .tab-lg remain supported.

Instance-scoped integration

The docs enhance only [data-dm-tabs] roots. Panels are resolved from each tab’s aria-controls; ownership checks prevent separate or nested groups from interfering.

API and compatibility

Area Selectors
Appearance .tabs, .tabs-pill, .tabs-tonal, .tabs-boxed, .tabs-lifted
Layout .tabs-vertical, .tabs-scrollable, .tabs-full, .tabs-center, .tabs-end
Sizes .tabs-sm, .tabs-md, .tabs-lg, legacy .tab-xs, .tab-sm, .tab-lg
Item states .tab-active, .tab-active-primary, .tab-active-secondary, .tab-active-tertiary
Item content .tab-icon, .tab-icon-only, .tab-badge
Panels .tab-panel, .tab-panel-show

.tab-active and legacy item sizes are compatibility APIs. Prefer aria-current="page" for route links and aria-selected for interactive tabs.