Skip to content

<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 ​

PropTypeDefaultDescription
uiRecord<string, unknown>{}Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last.
disabledbooleanGreys out every tab; none can be chosen.
blockbooleanStretch to the parent's width, tabs sharing it equally.
partsPartial<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.
optionsreadonly (string | XrTabOption)[][]The tabs: strings, or { label, value, disabled? }.
modelValuestringThe active tab's value (v-model).

Events ​

EventPayloadDescription
changevalue: string, option: XrTabOptionA tab other than the active one was chosen: its value and option.
update:modelValuevalue: stringA tab was chosen (v-model).

MIT License