navigation — wyrd.component.tabs

Tabs

Horizontal tab collection with index-matched content panels.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
overview state: selected
Project overview content.
Usage
import { WyrdTabs } from "@wyrd-company/react";

<WyrdTabs defaultValue="overview" items={[{"label":"Overview","value":"overview"},{"label":"Details","value":"details"},{"label":"History","value":"history"}]}>
  Project overview content.
  Detailed settings content.
  Change history content.
</WyrdTabs>

// events: onValueChange
disabled-item state: disabled
Project overview content.
Usage
import { WyrdTabs } from "@wyrd-company/react";

<WyrdTabs defaultValue="overview" items={[{"label":"Overview","value":"overview"},{"label":"Details","value":"details","disabled":true},{"label":"History","value":"history"}]}>
  Project overview content.
  Detailed settings content.
  Change history content.
</WyrdTabs>

// events: onValueChange
02

Properties

NameTypeDefaultSummary
value string undefined Controlled selected item value.
default-value string undefined Initial uncontrolled selected item value; when absent, the first non-disabled item is selected.
items array Ordered tab items; disabled items render but are skipped by focus movement and activation.
03

Slots & events

SlotCardinalityAcceptsSummary
content one-or-many component, content Index-matched tab panels; the Nth slotted child is the panel for the Nth item. All panels stay mounted, and only the selected panel is visible and exposed to assistive technology.
EventPayloadSummary
value-change value Emitted when the user activates an enabled tab with a different value.
04

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
tab.background color.surface
tab.foreground color.on-surface
tab.selected-background color.primary
tab.selected-foreground color.on-primary
tab.hover-background color.secondary
tab.indicator-color color.primary
tab.indicator-thickness 2px
tab.padding-x spacing.md
tab.padding-y spacing.sm
gap spacing.xs
05

States

StateSourceSummary
default platform Horizontal tab collection.
selected property State derived from value, default-value, or the first enabled item.
focus-visible platform Keyboard-visible focus state on a tab.
disabled property Disabled tab item state.
06

Accessibility

From the contract's accessibility obligations. Role tablist; The surrounding content should provide context for the tab collection.

  • Tab moves focus into the selected tab or focused tab.
  • ArrowLeft and ArrowRight move focus between enabled tabs with wrap-around without selecting.
  • Home and End move focus to the first and last enabled tabs.
  • Enter and Space activate the focused enabled tab.
  • Web projections expose role=tablist on the list, role=tab on each tab, aria-selected on tabs, and role=tabpanel on every index-matched panel.
  • Each panel is associated to its tab with aria-labelledby using stable per-instance ids.
  • Non-selected panels stay mounted but are hidden from visual rendering and assistive technology.
  • Disabled items are skipped by arrow-key focus movement and cannot be activated.
  • Flutter exposes selected button semantics for tabs; arrow-key traversal is not implemented in v1.
  • Verified under: rtl, reduced-motion, cvd-deuteranopia, density-compact, text-expansion.
07

SDUI

Status: serializable. Tabs serialize item records and index-matched panel content; the Nth serialized content child is the panel for the Nth item. Hosts must preserve order and keep all panels mounted while exposing only the selected panel visually and semantically.

SerializableMembers
Propertiesvalue, default-value, items
Slotscontent
Eventsvalue-change
The Wyrding Way — a contract-first design system. © Wyrd Company