Tabs
Panels switched by tabs.
MarkdownExamples
Basic
A summary of the project.
Counts
The tab slot replaces each tab's text, e.g. to add a count.
12 issues.
API
| Prop | Type | Default |
|---|---|---|
itemsTabs to render, in order. | SelectOption<T>[] | [] |
labelAccessible name for the tablist. | string | — |
disabledDisables every tab. | boolean | false |
modelValueThe selected tab's value. | T | — |
| Event | Payload |
|---|---|
update:modelValue
| [value: T | undefined] |
| Slot | Props |
|---|---|
defaultPanel content for the selected tab. | { value: T | undefined; } |
tabTab content. | { item: SelectOption<T>; selected: boolean; } |
Types
export interface SelectOption<T extends SelectValue = SelectValue> {
label: string;
value: T;
disabled?: boolean;
}
export type SelectValue = string | number;Copy codeStyling
--ui-indicator-x, --ui-indicator-width, --ui-indicator-top and --ui-indicator-height place the indicator on the selected item.
- Parts
tabstablisttab-indicatortabtabpanel- States
data-tabs-slidingdata-tabs-animatedata-tab-selected
Keyboard
| Keys | Action |
|---|---|
Tab | Focus the selected tab, then the panel |
← / → | Select the previous / next tab |
Home / End | Select the first / last tab |
Accessibility
- In right-to-left layouts,
←/→follow the visual direction.