Bridge UI

Tabs

Organize related content into tabbed views with TabList, Tab, TabPanel, and TabItem.

Introduction

Tabs organize related content into tabbed views. Compose with TabList, Tab, and TabPanel, or use the TabItem shortcut. The selected tab uses a quiet surface from variant; color optionally tints selected text and the line / solid / enclosed indicator.

Use the framework selector in the site header to switch between React and Vue.

Import

import { Tabs } from "@bridge-ui/vue/Components/Tabs";
import { Tab } from "@bridge-ui/vue/Components/Tab";
import { TabItem } from "@bridge-ui/vue/Components/TabItem";
import { TabList } from "@bridge-ui/vue/Components/TabList";
import { TabPanel } from "@bridge-ui/vue/Components/TabPanel";
import { Tabs } from "@bridge-ui/react/Components/Tabs";
import { Tab } from "@bridge-ui/react/Components/Tab";
import { TabItem } from "@bridge-ui/react/Components/TabItem";
import { TabList } from "@bridge-ui/react/Components/TabList";
import { TabPanel } from "@bridge-ui/react/Components/TabPanel";

Basic usage

Control selection with value / onChange (React) or v-model (Vue). Each Tab and TabPanel shares a value.

TabItem shortcut

TabItem renders both the tab trigger and its panel. Pass label for the trigger and children for the panel content.

Icons

Pass icons with startIcon / endIcon, or custom nodes via slots.start / slots.end.

Colors

Use the color prop to optionally tint selected text (and the line / solid / enclosed indicator). The selected surface comes from variant. Available colors: primary, secondary, success, info, warning, error, dark, and black.

Variants

Available variants: pill (default), line, plain, solid, and enclosed. Pair with any color from the palette above.

Vertical

Set orientation="vertical" for a side-aligned tab list.

Manual activation

With activation="manual", arrow keys move focus without changing the selected tab until Enter or Space.

Nested customProps

With TabItem, Tabs maps list/triggers/panels and merges customProps.tabList, customProps.tab, and customProps.tabPanel. Item-owned props (value, icons, label, keepMounted, panel content) are not overridable via nested customProps. TabItem slots are not shallow-merged from customProps.tab.

<Tabs
  defaultValue="bun"
  customProps={{
    tabList: { className: "gap-2" },
    tab: { classes: { root: "px-3" } },
  }}
>
  <TabItem label="bun" value="bun">
    bun install
  </TabItem>
  <TabItem label="npm" value="npm">
    npm install
  </TabItem>
</Tabs>

Badge, Avatar, Icon, Toggle Group, Stepper

API

Tabs

Prop Type Default
@update:model-value (value: string) => void —
v-model / modelValue string first registered tab
Prop Type Default
defaultValue string first registered tab
onChange (value: string) => void —
value string —
Prop Type Default Description
activation TabsActivation "automatic" Keyboard activation: automatic selects on arrow focus; manual needs Enter/Space.
color TabsColor "dark" Optional text accent for the selected tab. Selected surface comes from variant.
customProps TabsCustomProps — With TabItem, forwards props to mapped TabList / Tab / TabPanel. Item-owned props stay on each item.
keepMounted boolean true When true, inactive panels stay mounted (hidden).
orientation TabsOrientation "horizontal" Layout orientation of the tab list.
size TabsSize "md" Size of the tab list and triggers.
variant TabsVariant "pill" Visual style of the tab list / selected tab.

Tab

Prop Type Default
disabled boolean false
endIcon IconSource —
slots { start?, end? } —
startIcon IconSource —
value string required

TabList

HTML attributes on the role="tablist" container (aria-label, className, etc.).

TabPanel

Prop Type Default
keepMounted boolean inherits from Tabs
value string required

TabItem

Prop Type Default
children panel content —
disabled boolean false
endIcon IconSource —
keepMounted boolean inherits from Tabs
label ReactNode / Vue slot content required
slots { start?, end? } —
startIcon IconSource —
value string required