Skip to content

kit-tabs

<kit-tabs> coordinates slotted tabs and panels with ARIA state.

<kit-tabs>
<button slot="tab" data-tab="overview">Overview</button>
<button slot="tab" data-tab="activity">Activity</button>
<section slot="panel" data-panel="overview">Overview content.</section>
<section slot="panel" data-panel="activity">Activity content.</section>
</kit-tabs>
AttributeTypeNotes
selectedstringThe selected tab key. Defaults to the first tab.
aria-labelstringNames the tablist; defaults to Sections.
  • tab — tab controls. Use data-tab="<key>".
  • panel — tab panels. Use data-panel="<key>".
  • Adds role="tablist", role="tab", and role="tabpanel".
  • Maintains aria-selected, tabindex, and hidden.
  • Supports left/right arrow navigation.
  • Emits kit-tabs-change with { selected }.

Tabs are the first supplied component with a registration-free artifact/attachment path. Import KitTabsElement from @atheory-ai/kitsune-ui/elements/kit-tabs or createKitTabsComponent from @atheory-ai/kitsune-ui/components/kit-tabs; neither registers the catalog. The root import continues to register standalone elements.

createKitTabsComponent takes artifact identity/version, object slots, exact requirements, a selection query/input mapping, and a change command/input mapping. It returns the common { descriptor, element, connect } definition. Its properties are an optional label and a required array of { id, label, text } panels with unique nonempty keys. The query returns one selected key as a string. The application chooses operation names and retention policy; the supplied component creates no runtime or store.

Attach through the app host/attachment or delivery APIs. Snapshots update selection silently; clicks/arrows emit the existing semantic event and invoke the declared command once. The displayed panel follows authoritative selection. Pending requests preserve focus and gate repeated interactions; failures are visible and do not optimistically select another panel. Unknown keys produce an unavailable view with hidden panels. Detach/rebinding releases the session hook and clears obsolete selection.

The RuntimeControlled Storybook example supplies an explicit environment host. Native acceptance verifies shared selection, exact-version replacement/reload, and no synthetic commands. The first artifact renderer supports plain text panels; richer content uses the existing standalone slots pending broader composition work.