Skip to content

Tabs ​

A set of layered sections of content, known as tab panels, that are displayed one at a time.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Controlled ​

Bind the active tab with !! like v-model. Icons and disabled triggers are supported.

Approximate web preview — the HarmonyOS rendering is the reference.

Overflow ​

Without breakpoints: when the triggers are wider than the space the list gets, it scrolls horizontally.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

STabs ​

shadcn-vue Tabs: a set of layered sections of content, one shown at a time.

PropTypeDefaultDescription
value!!string | undefinedundefinedControlled active tab (use with !!). Leave undefined for uncontrolled.
defaultValuestring''
EventTypeDefaultDescription
onValueChange(value: string) => void() => { }

Slots: children (trailing closure)

STabsList ​

The tab strip: bg-muted text-muted-foreground inline-flex h-9 w-fit rounded-lg p-[3px]. Responsive: when the triggers are wider than the space the list gets, the strip scrolls horizontally.

PropTypeDefaultDescription
tokensTabsTokens{}Per-instance token overrides (instance → theme --tabs-* → recipe), see {@link TabsTokens}.

Slots: children (trailing closure)

STabsTrigger ​

A tab button. rounded-md px-2 py-1 text-sm font-medium; active: bg-background shadow-sm (dark: bg-input/30 border-input). Activates its tab when tapped; the native .onClick() on the trigger itself is not needed (use onValueChange on STabs).

PropTypeDefaultDescription
valuestring''
textResourceStr | undefinedundefined
iconstring | undefinedundefinedLeading lucide icon name.
disabledbooleanfalse

Slots: children (trailing closure)

STabsContent ​

Panel shown while its value is the active tab (fades in).

PropTypeDefaultDescription
valuestring''

Slots: children (trailing closure)

MIT Licensed