Tabs
A segmented control for switching between views of the same content.
<template> <Tabs v-model="active" :items="[{ label: 'Overview', value: 'overview' }, { label: 'Activity', value: 'activity' }]" :content="false" color="neutral" /></template>Props
| Name | Type | Default |
|---|---|---|
| items | { label?, value?, icon?, avatar?, badge?, disabled?, ... }[] | - |
| modelValue | string | number | - |
| content | boolean | true (UTabs's own default) |
| block | boolean | false |
| label | string | - |
| ...props | UTabs props (color, size, orientation, unmountOnHide, valueKey, labelKey, ...) | - |
Guidelines
Do
- Use for a segmented filter control switching between views of the same data.
- Use
blockwhen the control spans its container (an either-or choice in a form) so every segment is the same width. - Pass
labelso the control has an accessible name; there is no visible label on a tab strip.
Don't
- Don't use tabs to step through a sequential, ordered flow - use
StepperorStepperVerticalinstead. - Don't hide destructive or primary actions behind a tab a user might not think to check.
Examples
Block
`block` stretches the control across its container and gives every segment the same width, whatever the label length. For an either-or choice in a form; leave it off for a content-sized filter bar.
<template> <Tabs v-model="choice" :items="[{ label: 'GitHub App', value: 'app' }, { label: 'Personal access token', value: 'pat' }]" :content="false" color="neutral" block /></template>