Skip to content

Tabs

Tabs are used to display content in a single container.

Loading Code Block...

Dashboard Overview

Welcome to your dashboard. Here you can view key metrics and recent activity.

Total Users

1,234

Revenue

$45,678

Loading Code Block...

Dashboard Overview

Welcome to your dashboard. Here you can view key metrics and recent activity.

Total Users

1,234

Revenue

$45,678

Loading Code Block...

PropsDefaultTypeDescription
tabs-TabItem[]Array of tab items. Each item requires a unique `id: string` (used for selection identity, both frameworks) and `tabName`, plus optional `href`, `content`, `active` boolean, `icon`, and `count` badge.
activeTabId-stringInitially active tab, matched by `id`. Falls back to the first item with `active: true`, then to the first item.
showBadgestruebooleanIf set, the tabs will have badges.
showIconstruebooleanIf set, the tabs will have icons.
badgeBgColorbg-purple-500stringBackground color for badges (Tailwind class).
badgeTextColortext-whitestringText color for badges (Tailwind class).
activeColortext-theme-text-accent border-theme-border-primarystringText and color for tab items when active (Tailwind class).
textColortext-theme-text-secondarystringText color for inactive tab labels (Tailwind class).
hoverColorhover:border-theme-border-default hover:bg-theme-bg-default-hover focus:bg-theme-bg-default-pressstringHover and focus styles applied to inactive tabs (Tailwind classes).
activeTextColortext-theme-text-secondarystringText color for the active tab label inside the mobile dropdown (Tailwind class). Desktop active label color is controlled by `activeColor`.
onChange-functionReact-only. Callback `(tab: TabItem) => void` invoked when a tab is selected. Vue exposes the same event as `@change` (emits the selected `TabItem`).
PropsDefaultTypeDescription
id-string**Required.** Stable identifier used for selection. Two items with the same `id` are treated as the same tab.
tabName-stringVisible label for the tab.
href-string**Required.** Anchor target rendered on the desktop tab `<a>`. Click handling calls `preventDefault()` — navigation is the consumer's responsibility; `href` is kept for accessibility and link semantics.
content-ReactNode | VNodePanel content rendered when the tab is active. In Vue, the preferred surface is a named slot keyed by the tab `id` (`<template #my-tab-id>…</template>`); `content` is used as a fallback when no matching slot is provided.
activefalsebooleanMarks an item as initially active. Overridden by `activeTabId` on the parent.
icon-ReactNode | VNodeOptional leading icon rendered when `showIcons` is true.
count-string | numberOptional badge value rendered when `showBadges` is true.
  • Tab lists utilize appropriate ARIA roles (role="tablist", role="tab", and role="tabpanel") to ensure screen readers announce correctly which tab is currently selected.
  • Keyboard navigation behaves such that users can ‘tab’ to enter the tab list, use the Left and Right arrows to move between tabs natively, and use ‘Enter’ or ‘Space’ to select them.