Tabs

Local panels with keyboard selection or canonical route links in an explicit mode.

Switch panels with pointer or keyboard input without a server request.

Open in new tab

Each preview is its own Live page in a frame, because this site is a Vue 3.5 app built on the Pulsar starter kit. An open list or popover stays inside its frame; in your application it opens over the page.

Installation

bash
suprnova live:add tabs

Usage

html
{% import "suprnova-ui/tabs/tabs.html" as tabs %}
{% call tabs::tabs("guides", mode="route", label="Guides") %}{% call tabs::route_tab("/docs", "Manual", current=true) %}{% endcall %}{% endcall %}

Examples

Route tabs

Anchors navigate to shareable destinations and mark the current one.

Open in new tab

Keyboard and accessibility

suprnova.tabs - two explicit modes (NAV-002). Local tabs: sn-tabs owns the tablist's arrow keys and selection, tabs and panels are keyed and preserved so the selection is the browser's across a morph, and a tab change makes no request. Route tabs: anchors with canonical URLs and aria-current from the server, plain document navigation. The mode is a required argument; there is no default.

API reference

tabs

ParameterDefaultDescription
idRequiredUnique tabs region ID.
modeRequiredRequired mode: local panels or route navigation.
labelRequiredAccessible name of the tabs region.

tab_list

ParameterDefaultDescription
labelRequiredAccessible name of the local tablist.

tab

ParameterDefaultDescription
keyRequiredUnique tab ID and stable morph key.
panelRequiredID of the panel this tab controls.
textRequiredVisible tab label.
selectedfalseInitial selection; subsequent selection belongs to the browser.

tab_panel

ParameterDefaultDescription
keyRequiredUnique panel ID and stable morph key.
tabRequiredID of the tab that labels this panel.
selectedfalseInitial visibility; unselected panels start hidden.

route_tab

ParameterDefaultDescription
hrefRequiredCanonical destination URL.
textRequiredVisible destination name.
currentfalseServer-authoritative current route, marked with aria-current.