Tab List

Alignment target:@astryxdesign/core v0.7.1 · TabList

TabList Props #

NameTypeDefaultDescription
valuestring-Currently selected tab value. Supports v-model:value.
sizeTabListSize'md'Tab size. Optional: sm, md, lg.
layoutTabListLayout'hug'Tab layout. Optional: hug, fill. hug sizes to content, fill distributes evenly.
hasDividerbooleanfalseWhether 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.
rolestring-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 #

NameDescription
update:valueEmitted when the selected value changes.
changeEmitted when the selected value changes.

TabList Slots #

NameDescription
defaultList of Tab elements.

Tab Props #

NameTypeDefaultDescription
valuestring-Unique tab value.
labelstring-Visible text of the tab, also used as the accessible name when isLabelHidden is set. The default slot wins when both are given.
hrefstring-URL to navigate to. Outside the tabs pattern the tab renders as a link; inside a role="tablist" strip it is ignored.
asstring | Component'a'Link root component, such as a router link. Only applies when href is given and the strip is not a tablist.
isLabelHiddenbooleanfalseVisually hides the label so only the icon and end content show. The label stays available through aria-label.
panelIdstring-ID of the controlled panel for aria-controls.
disabledbooleanfalseWhether the tab is disabled.

Tab Slots #

NameDescription
defaultTab label text.
iconIcon shown while the tab is not selected.
selectedIconIcon shown while the tab is selected. Falls back to icon.
endContentContent after the label, such as a badge count or a status dot.