vael-ui v0.3.10

Navigation & Menus

Tabs

Switches between panels of content, with a sliding indicator under the active tab.

Install

import { Tabs } from 'vael-ui'

Playground

import { Tabs } from 'vael-ui'

<Tabs orientation="horizontal" activation="automatic" :items="items">Tabs</Tabs>

Props

NameTypeDefaultDescription
itemsT[]
orientation"horizontal" | "vertical""horizontal"Vertical layout with ↑/↓ navigation.
activation"automatic" | "manual""automatic"`automatic` (default): arrow keys select. `manual`: arrow keys move focus only; Enter/Space selects.
uiPartial<{ list: UiPartValue; item: UiPartValue; indicator: UiPartValue; }> | undefined
activeT

Slots

NameTypeDescription
default{ active: T; focused: T; select: (item: T) => void; items: T[]; itemProps: (item: T) => { role: "tab"; class: string; style: StyleValue; 'data-tab-value': string; 'aria-selected': boolean; tabindex: 0 | -1; onClick: () => void; }; indicatorProps: (variant?: "background" | "underline" | undefined) => { class: string; style: Record<string, string | undefined>; }; }Render `role="tab"` elements and optionally a sliding indicator. `itemProps(item)` returns a11y/behavior wiring for one tab — spread via v-bind. `indicatorProps(variant)` does the same for the optional sliding highlight (`'background'` default, or `'underline'`) — bind it on a sibling element of the tab buttons. `focused` tracks roving tabindex (diverges from `active` in `manual` mode).

Events

NameTypeDescription
change[item: T]
update:active[value: T]

Exposed

NameTypeDescription
listElunknownType inference unavailable — vue-component-meta cannot resolve defineExpose on this generic component.