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.
| Prop | Type | Default | Description |
|---|---|---|---|
value!! | string | undefined | undefined | Controlled active tab (use with !!). Leave undefined for uncontrolled. |
defaultValue | string | '' |
| Event | Type | Default | Description |
|---|---|---|---|
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.
| Prop | Type | Default | Description |
|---|---|---|---|
tokens | TabsTokens | {} | 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).
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | '' | |
text | ResourceStr | undefined | undefined | |
icon | string | undefined | undefined | Leading lucide icon name. |
disabled | boolean | false |
Slots: children (trailing closure)
STabsContent
Panel shown while its value is the active tab (fades in).
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | '' |
Slots: children (trailing closure)