<XrTabs>
Segmented tabs that switch a value. Show the matching content with v-if.
Usage
vue
<XrTabs v-model="tab" :options="['Controls', 'List', 'Theme']" block />
<XrBox v-if="tab === 'Controls'">…</XrBox>API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
ui | Record<string, unknown> | {} | Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last. |
disabled | boolean | Greys out every tab; none can be chosen. | |
block | boolean | Stretch to the parent's width, tabs sharing it equally. | |
parts | Partial<Record<TabPart, Record<string, unknown>>> | Raw uikit properties per inner part, merged after the defaults: tab (every tab), selected (the chosen tab, after tab), label. | |
options | readonly (string | XrTabOption)[] | [] | The tabs: strings, or { label, value, disabled? }. |
modelValue | string | The active tab's value (v-model). |
Events
| Event | Payload | Description |
|---|---|---|
change | value: string, option: XrTabOption | A tab other than the active one was chosen: its value and option. |
update:modelValue | value: string | A tab was chosen (v-model). |