Tabs
tabsTabs built on the Base UI primitive, so arrow keys, Home and End and the roving tab order come for free. The primitive measures the selected tab and publishes it as a CSS variable, so the underline glides without this component holding a single ref.
import { Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger } from "@/components/forme/tabs/tabs";
const panels: Record<string, string> = {
overview:
"Fourteen components, one token set and no runtime of their own. Everything you copy in stays yours to edit.",
activity:
"Arrow keys move between tabs, Home and End jump to the ends, and the underline glides to the selection rather than blinking.",
settings:
"The primitive measures the selected tab and publishes it as a CSS variable, so this component holds no refs and no observers.",
};
export function TabsDemo() {
return (
<div className="flex flex-col gap-8">
<Tabs defaultValue="overview" className="w-full max-w-2xl">
<TabsList aria-label="Sections">
<TabsIndicator />
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="activity">Activity</TabsTrigger>
<TabsTrigger value="settings">Settings</TabsTrigger>
<TabsTrigger value="billing" disabled>
Billing
</TabsTrigger>
</TabsList>
{Object.entries(panels).map(([value, body]) => (
<TabsContent
key={value}
value={value}
className="pt-4 text-body-regular text-muted-foreground"
>
{body}
</TabsContent>
))}
</Tabs>
<Tabs defaultValue="usage" className="w-full max-w-2xl">
<TabsList aria-label="Install">
<TabsIndicator />
<TabsTrigger value="usage">Install</TabsTrigger>
<TabsTrigger value="cli">CLI</TabsTrigger>
</TabsList>
<TabsContent value="usage" className="pt-4 text-body-regular text-muted-foreground">
One command, then the file lands in your project. No package to keep up to date.
</TabsContent>
<TabsContent value="cli" className="pt-4 text-body-regular text-muted-foreground">
The CLI reads the same registry the site does, so{" "}
<code className="font-mono">npx @formeui/cli add dialog</code> always installs what the
page shows.
</TabsContent>
</Tabs>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
Usage
import { Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger } from "@/components/forme/tabs/tabs";
<Tabs defaultValue="overview">
<TabsList>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="activity">Activity</TabsTrigger>
<TabsIndicator />
</TabsList>
<TabsContent value="overview">…</TabsContent>
<TabsContent value="activity">…</TabsContent>
</Tabs>When to use
Reach for it
- Sibling panels of the same object — Overview, Activity, Settings — where only one is needed at a time.
Use something else
- Switching how the same content is shown (List, Board): that is a
SegmentedControl. - Steps that must happen in order; use
Steps.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
Parts
TabsTakes Base UITabs.RootTabsListTakes Base UITabs.ListTabsIndicatorTakes Base UITabs.IndicatorTabsTriggerTakes Base UITabs.TabTabsContentTakes Base UITabs.Panel
Accessibility
- The WAI-ARIA tabs pattern from Base UI: one tab stop for the list, arrow keys between tabs, and each panel labelled by its tab.
Motion
- The underline glides to the selected tab using measurements Base UI writes as custom properties.
- It renders before hydration, so a server-rendered page shows it on the first frame.
Related


Breadcrumb
Where a page sits in the hierarchy, as a labelled nav with an ordered list and the current page marked. Separators are drawn in CSS, so a screen reader hears the path and not the slashes.
navigation

Command menu
A command palette opened with ⌘K or Ctrl K, with a search field, grouped items, keyword matching and an empty state. Built on cmdk for the filtering and the keyboard path, inside a Radix dialog for the focus trap.
navigation

Dock
A macOS-style row of icons that swell under the pointer on a spring, with their neighbours growing too. Labels show on hover and focus, open apps get a dot, and reduced motion keeps every icon at its resting size.
navigation