Skip to content

Tabs ​

Tabs runtime: Root owns the active value; Trigger/Content associate through the same value.

Runtime ​

State contracts come from @varo-ui/headless; rendered parts come from @varo-ui/h5/primitives or @varo-ui/weapp/primitives.

Demo ​

Package@varo-ui/headless
Panel A

Basic usage ​

Use the Demo panel above to switch H5 and Weapp primitive preview/code; each runtime renders only the current entry.

Controlled unique values ​

Trigger/Content values must stay unique inside one TabsRoot; H5 automatic mode supports arrow-key movement.

Parts ​

PartPurpose
TabsRootActive value and orientation
TabsListTrigger container
TabsTriggerOne tab title
TabsContentMatching panel

Props ​

TabsRoot ​

PropTypeDefaultDescription
valuestring | number | undefinedundefinedControlled active value
defaultValuestring | numberundefinedUncontrolled initial value
orientationstringundefinedOrientation semantics
disabledbooleanfalseDisables the whole tabs root
idstringundefinedAssociation id prefix
asstring'div'Root element tag

TabsTrigger / TabsContent ​

PropTypeDescription
valuestring | numberUnique value associated with Root
disabledbooleanTrigger-only disabled flag

Events ​

EventPayloadDescription
update:valuestring | numberControlled sync
valueChangestring | numberActive value change

Accessibility ​

  • Value drives both state and panel association.
  • H5 supports arrows/Home/End.
  • Weapp keeps ARIA and value association without browser focus simulation.

Platform notes

  • H5 can demonstrate keyboard behavior.
  • The mini-program tab uses the Weapp primitive runtime to render the current Tabs entry. :::