Skip to content

Tabs ​

Tab navigation for switching between content sections.

Open in Storybook

Interactive Demo ​

Active: overview

Usage ​

vue
<script setup>
import { ref } from 'vue';
import { TabGroup } from '@yellowcard/b2b-design-system';

const activeTab = ref('overview');
const tabs = [
  { key: 'overview', label: 'Overview' },
  { key: 'transactions', label: 'Transactions' },
  { key: 'settings', label: 'Settings' },
];
</script>

<template>
  <TabGroup v-model="activeTab" :tabs="tabs" />
</template>

API Reference ​

Props ​

PropTypeDefaultDescription
modelValuestring—Active tab key (v-model)
tabs*Tab[]—Array of tab objects with key and label
sizestring—Tab size
typestring—Tab style type
radiusstring—Border radius
fullWidthbooleanfalseStretch tabs to full width
ariaLabelstring—Accessible label for tablist

Events ​

EventPayloadDescription
update:modelValuestringActive tab changed

Accessibility ​

  • Uses role="tablist" with role="tab" for each item
  • Arrow keys navigate between tabs
  • aria-selected reflects active state