Tabs
Switch between views of the same subject. One indicator slides and stretches between tabs on a spring, rather than each tab fading on its own.
Install
npx shadcn@latest add @nelumbo/tabsPill
The default, like shadcn's: a raised pill on a tonal track. Arrow keys move between tabs; Home and End jump to the ends.
Underline
Material's primary tabs: a 3px bar under the label on a hairline. Icons fill in on the active tab; a badge shows a count or a dot.
Muted
tone="muted" keeps the pill but swaps the solid selected tab for a soft raised one, for something more subtle.
Full width and brand color
fullWidth shares the width equally. The underline can use the accent.
Scrolling
When tabs don't fit, an underline list scrolls sideways and keeps the active tab in view.
Usage
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"<Tabs defaultValue="inbox"> <TabsList variant="underline"> <TabsTrigger value="inbox" icon="inbox" badge={12}>Inbox</TabsTrigger> <TabsTrigger value="sent" icon="send">Sent</TabsTrigger> </TabsList> <TabsContent value="inbox">…</TabsContent> <TabsContent value="sent">…</TabsContent></Tabs>Props
Tabs, TabsTrigger and TabsContent take Radix Tabs props (value, onValueChange, activationMode…).
| Prop | Type | Default | Notes |
|---|---|---|---|
TabsList variant | "pill" | "underline" | "pill" | |
TabsList color | "auto" | "neutral" | "brand" | "auto" | Underline color |
TabsList tone | "bold" | "muted" | "bold" | Pill lists: a solid inverse pill, or a soft raised one |
TabsList fullWidth | boolean | false | Tabs share the width |
TabsTrigger icon | IconName | Fills in when active | |
TabsTrigger badge | number | boolean | A count, or a dot |