Tab List
Alignment target:@astryxdesign/core v0.7.1 · TabList
TabList Props #
| Name | Type | Default | Description |
|---|---|---|---|
value | string | - | Currently selected tab value. Supports v-model:value. |
size | TabListSize | 'md' | Tab size. Optional: sm, md, lg. |
layout | TabListLayout | 'hug' | Tab layout. Optional: hug, fill. hug sizes to content, fill distributes evenly. |
hasDivider | boolean | false | Whether to show a bottom divider. |
overflow | 'auto' | 'scroll' | 'visible' | 'auto' | What happens when the tabs are wider than the strip. auto and scroll scroll sideways, fade the hidden edge, and offer page arrows. visible does not scroll. A selected tab that is out of view scrolls back into view immediately. |
role | string | - | ARIA role of the strip. tablist selects the tabs pattern: tabs get role="tab" with aria-selected, and each tab points at its panel through panelId. Left unset, the strip is a navigation landmark that marks the current tab with aria-current and renders a tab with href as a link. Any other value is passed through to the element. |
TabList Events #
| Name | Description |
|---|---|
update:value | Emitted when the selected value changes. |
change | Emitted when the selected value changes. |
TabList Slots #
| Name | Description |
|---|---|
default | List of Tab elements. |
Tab Props #
| Name | Type | Default | Description |
|---|---|---|---|
value | string | - | Unique tab value. |
label | string | - | Visible text of the tab, also used as the accessible name when isLabelHidden is set. The default slot wins when both are given. |
href | string | - | URL to navigate to. Outside the tabs pattern the tab renders as a link; inside a role="tablist" strip it is ignored. |
as | string | Component | 'a' | Link root component, such as a router link. Only applies when href is given and the strip is not a tablist. |
isLabelHidden | boolean | false | Visually hides the label so only the icon and end content show. The label stays available through aria-label. |
panelId | string | - | ID of the controlled panel for aria-controls. |
disabled | boolean | false | Whether the tab is disabled. |
Tab Slots #
| Name | Description |
|---|---|
default | Tab label text. |
icon | Icon shown while the tab is not selected. |
selectedIcon | Icon shown while the tab is selected. Falls back to icon. |
endContent | Content after the label, such as a badge count or a status dot. |