Navigation
ITabs
Switches between panels on the same page. Items come from an array, and the indicator animates between triggers.
A string item becomes both the label and the value. Pass objects when the two differ, or when an item needs an icon or should be disabled.
Variants
solid sits the active tab on a filled pill; line underlines it, which suits tabs sitting directly above the content they switch.
Panels
Give each item a value and fill the matching named slot. Each slot receives the item it belongs to.
Four line items totalling €1,240.00.
Vertical
orientation="vertical" stacks the triggers down the side, and arrow-key navigation follows the orientation.
Keeping panels mounted
By default only the active panel is in the DOM. keepMounted renders them all and hides the inactive ones, which keeps form state, scroll position and anything expensive to rebuild.
<ITabs v-model="tab" :items="items" keep-mounted />Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | (TabsItem | string)[] | [] | Tabs to render |
variant | 'solid' | 'line' | 'solid' | Pill or underline |
orientation | 'horizontal' | 'vertical' | 'horizontal' | Trigger direction, and arrow-key axis |
keepMounted | boolean | false | Render every panel, hiding the inactive ones |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Merged with the built-in classes |
ui | { root?, list?, indicator?, trigger?, content? } | — | Per-slot class overrides |
The model is the active item's value, falling back to its label.
interface TabsItem {
label: string
/** Identifies the tab. Defaults to the label. */
value?: string
icon?: IconLike
disabled?: boolean
}Slots
| Slot | When to use it |
|---|---|
<value> | The panel for that item, receiving { item } |
trigger | Custom trigger content, receiving { item } |
list | Replaces the whole trigger row |
| default | Replaces the panel area entirely |
For switching between pages rather than panels, use INavigationMenu or plain links.