Tabs
Views that share one place on the page, switched by a list of tabs.
Import
import { Tabs } from '@vitral/vue';Basic
Files you opened in the last week.
Scrollable
`scrollable` lets tabs that do not fit scroll along the strip, across or upright. The buttons move nearly a page at a time; `scroll-buttons` puts one at each end (`sides`, the default, each shown only while there is more that way), both together at the `start` or the `end`, or `none`. The selected tab is always brought into view — press End on the tabs to see it follow.
The report for January.
The report for January.
Vertical
Name, email and password.
Styles
One component, five looks beside the default tinted selection: a quiet one with only the pill, an underline as wide as the tab, filled pills, a segmented control and tabs with an icon and a count. Each is the component's tokens changed for one instance with `dt` — the segmented track adds a style through `pt` — so a preset gives every Tabs the same look by setting the same tokens.
Activity lives here.
Manual activation
With `select-on-focus` off, the arrows only move focus; Enter or Space selects.
Rendered only while selected (`lazy`).
API
Read from packages/vue/src/components/Tabs/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| orientation | 'horizontal' | 'vertical' | Tabs above the panels (the default) or beside them. |
| lazy | boolean | Render a panel only while its tab is selected. |
| selectOnFocus | boolean | Select a tab as soon as the arrow keys reach it: the APG's automatic activation, and the default. Off, the arrows only move focus and Enter/Space select. |
| scrollable | boolean | Tabs that do not fit scroll along the strip, with a button at each end that has more to show; the selected tab is always brought into view. |
| scrollButtons | 'sides' | 'start' | 'end' | 'none' | Where a scrollable strip's buttons go: one at each end (`'sides'`, the default), both together at the start or at the end, or none — the arrow keys, the wheel and a swipe still scroll it. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | — |