ComponentsMarkdown
Tabs
Switch between related panels using a 1px bottom border bar and a 4px primary active trigger rule. Built on Radix Tabs for keyboard navigation and ARIA linking.
Live example
Active triggers use a 4px primary bottom rule and foreground text.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| Tabs.defaultValue / value | string | — | Initial or controlled active tab value. |
| TabsList.size | "sm" | "md" | "lg" | "md" | Control height tier shared by all triggers in the list. |
| TabsTrigger.value | string | — | Unique identifier linking the trigger to its TabsContent. |
| TabsTrigger.disabled | boolean | false | Prevents activation and skips keyboard focus. |
Sizes and tokens
| Tier / Role | Token | Value |
|---|---|---|
| sm trigger | --control-height-sm | 32px height |
| md trigger | --control-height-md | 40px height |
| lg trigger | --control-height-lg | 48px height |
| List hairline | --border-width-1 / --border | 1px bottom border |
| Active rule | --border-width-4 / --primary | 4px bottom rule on active trigger |
States
Compact tab bar at --control-height-sm.
Touch-friendly tab bar at --control-height-lg.
Code
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "@freshgemui/monoplinth";
export function Example() {
return (
<Tabs defaultValue="overview">
<TabsList>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="tokens">Tokens</TabsTrigger>
</TabsList>
<TabsContent value="overview">Overview content</TabsContent>
<TabsContent value="tokens">Token table</TabsContent>
</Tabs>
);
}Do and don't
Do: Keep tab labels concise and in a single horizontal row
Use 1–2 word labels so triggers remain scannable without wrapping across lines.
Don't: Use Tabs for top-level page navigation
Do not use Tabs when each view has its own URL route; use Link elements inside a navigation landmark instead.
Accessibility
ArrowLeft,ArrowRight,Home, andEndmove focus between enabled triggers.- Focus ring renders on
:focus-visibleonly using2px--ringwith2pxoffset. - Active state pairs
4px--primarybottom border with--foregroundtext so selection does not rely on color alone.
Rationale
Matching TabsList heights to --control-height-{sm,md,lg} and marking active triggers with a 4px architectural rule aligns tab bars with form controls and section headers.