| title | Tabs | |||||||
|---|---|---|---|---|---|---|---|---|
| status | ready | |||||||
| thumb | true | |||||||
| description | Tabs allow users to navigation between grouped content in different views while within the same page context. | |||||||
| storybook | https://dialtone.dialpad.com/vue/?path=/story/components-tabs--default | |||||||
| figma_url | https://www.figma.com/design/W58r5BkO8qTw3vem9YieJd/DT9-Component-Library--Rebrand-2025-?node-id=2129-4760 | |||||||
| keywords |
|
Remove the bottom border of any tablist.
All tabs render as muted buttons. The selected tab is distinguished with active styling.
The selected tab renders with an outlined border instead of a filled style.
Combines muted kind with outlined selected state.
Add disabled to a specific tab.
Add disabled to the tab group to disable all.
inverted prop has been deprecated. Use the v-dt-mode directive instead.
In place of the inverted prop, use the v-dt-mode directive on the component element.
Control how tabs distribute available horizontal space within the tab list. It only applies to horizontal tabs, and has no effect with orientation="vertical".
Tabs expand proportionally to fill the container. Longer labels receive more space.
All tabs share the same width, regardless of label length.
Use the #startIcon or #endIcon slot on dt-tab to add an icon. The slot provides iconSize to match the tab's size.
#icon slot has been deprecated. Use #startIcon or #endIcon instead.
Use the #leading and #trailing slots on dt-tab to render content like badges or count indicators alongside tab labels. Use leading-class and trailing-class to adjust padding.
Set orientation="vertical" to stack tabs vertically alongside the panel.
By default, tabs use manual activation — the user must press Enter or Space after focusing a tab to select it. Set activation-mode="auto" to select tabs immediately on focus via arrow keys, following the WAI-ARIA Tabs pattern.
If you need to do some validation before changing tabs, you can use the before-change event. If the event handler is prevented, the tab change will be cancelled.
<code-example-tabs :htmlCode='() => $refs.validateTabsExample' vueCode=' <dt-tab-group @before-change="confirmBeforeLeave"> <template #tabs> First Second Third
<script setup> function confirmBeforeLeave (event) { const confirmed = confirm("Are you sure to change tab?"); if (!confirmed) { event.preventDefault(); } } </script>' showHtmlWarning />
To create accessible tabs, be sure to implement the proper keyboard navigation and utilize the following ARIA roles to properly declare element roles, content relationships, and current status:
<script setup> import ExampleTabs from "@exampleComponents/ExampleTabs.vue"; </script>