Skip to content

Tab List

Usage ​

Import TabList and Tab from their dedicated entry and control selection with v-model:value.

vue
<script setup lang="ts">
import { Tab, TabList } from '@astryx-vue/core/TabList'
import { ref } from 'vue'

const value = ref('overview')
</script>

<template>
  <TabList v-model:value="value">
    <Tab value="overview">
      Overview
    </Tab>
    <Tab value="props">
      Props
    </Tab>
    <Tab value="examples">
      Examples
    </Tab>
  </TabList>
</template>

Best practices ​

GuidancePractice
RecommendedUse semantic role="tablist", role="tab", and aria-selected for accessible tabs.
RecommendedGive each Tab a unique value for selection and keyboard navigation.
RecommendedUse disabled for unavailable tabs; keyboard navigation skips them automatically.
Don'tPut too many tabs in a single strip; consider scrolling or reorganizing content when it overflows.
Don'tUse TabList for page-level navigation; Breadcrumbs or Link are better for wayfinding.

Examples ​

Basic

A basic tab list that switches the selected value on click.

Sizes

Tabs come in sm, md, and lg sizes.

With divider

Use has-divider to add a bottom border to the tab list.