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
modelValuestringActive tab key (v-model)
tabs*Tab[]Array of tab objects with key and label
sizestringTab size
typestringTab style type
radiusstringBorder radius
fullWidthbooleanfalseStretch tabs to full width
ariaLabelstringAccessible 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