GitHub

Tabs

Tabbed interface with placements, closable tabs, and htmx lazy loading.

<rhx-tab-group>

Examples

Basic Tabs

General account settings. Configure your display name, email, and language preferences.

Placements

Bottom

Content for tab one (bottom placement).

Start (vertical)

Dashboard overview with key metrics and quick actions.

End (vertical)

Info panel content (end placement).

Manual Activation

First tab content. Use arrow keys to move focus, then Enter/Space to select.

Closable Tabs

Document 1 content. Close this tab to see the next one activate.

Disabled Tab

This tab is active. The "Disabled" tab cannot be clicked or focused via keyboard.

htmx Lazy Loading

This panel was rendered with the page. The other tabs will load content via htmx when first clicked.

Properties

Property Type Default Description
rhx-placement string top Tab bar position: top, bottom, start, end
rhx-activation string auto Activation mode: auto (arrow keys activate), manual (Enter/Space to activate)
aria-label string - Accessible label for the tab group

Tab Properties

Properties for <rhx-tab> elements.

Properties

Property Type Default Description
rhx-panel string - Name of the associated tab panel
rhx-active bool false Whether this tab is initially active
rhx-closable bool false Shows a close button on the tab
rhx-disabled bool false Disables the tab

Panel Properties

Properties for <rhx-tab-panel> elements.

Properties

Property Type Default Description
rhx-name string - Panel name matching the tab's rhx-panel value
rhx-active bool false Whether this panel is initially visible

Accessibility

  • Uses role="tablist" on the tab bar with role="tab" on each tab and role="tabpanel" on each panel.
  • Active tab receives aria-selected="true"; panels are linked via aria-controls and aria-labelledby.
  • Arrow keys navigate between tabs; Home and End jump to the first and last tab.
  • In manual activation mode, arrow keys move focus only; Enter or Space activates the focused tab.
  • Disabled tabs receive aria-disabled="true" and are skipped during keyboard navigation.
  • Vertical placements (start, end) set aria-orientation="vertical" and use up/down arrow keys.