Tabs
Tabbed panels with a sliding light indicator and roving focus.
Installs motion.
Profile
This is how your name appears on deployments and comments.
Installation
npx shadcn@latest add https://neonkit.heyaadi.com/r/tabs.jsonUsage
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
<Tabs defaultValue="account">
<TabsList>
<TabsTrigger value="account">Account</TabsTrigger>
<TabsTrigger value="password">Password</TabsTrigger>
</TabsList>
<TabsContent value="account">…</TabsContent>
<TabsContent value="password">…</TabsContent>
</Tabs>Examples
Underline
variant="underline" draws a glowing line on a hairline track. Good for code.
Colors
Every Tabs gets its own indicator, so several can sit side by side.
Vertical
orientation="vertical" stacks the list beside the panels. Up and Down move between tabs.
Manual activation
Arrow keys move focus; Enter or Space selects. Disabled tabs are skipped.
API reference
Tabs
Renders a div and accepts every native div attribute.
| Prop | Type | Default |
|---|---|---|
defaultValue | stringInitially selected tab when uncontrolled. | None |
value | stringSelected tab when controlled. | None |
onValueChange | (value: string) => voidCalled when the selection changes. | None |
variant | "pill"Indicator style. | "pill" |
orientation | "horizontal"Direction of the list. Vertical puts it beside the panels and switches the arrow keys to Up and Down. | "horizontal" |
activationMode | "automatic"Select on focus, or wait for Enter and Space. | "automatic" |
color | NeonColorPalette name or hex. Falls back to --neon-accent, then cyan. | inherited |
TabsTrigger
Renders a button.
| Prop | Type | Default |
|---|---|---|
value | stringMatches a TabsContent value. | None |
disabled | booleanSkipped by the keyboard and not clickable. | false |
TabsContent
Renders a div that fades in when selected.
| Prop | Type | Default |
|---|---|---|
value | stringMatches a TabsTrigger value. | None |
forceMount | booleanKeeps the panel mounted but hidden while inactive, so its state survives. | false |
Accessibility
- Follows the WAI-ARIA tabs pattern: tablist, tab and tabpanel roles, with aria-selected and aria-controls wired up.
- Only the selected tab is in the Tab order. Left and Right arrows (Up and Down when vertical) move between tabs, Home and End jump to the ends.
- Panels are focusable so keyboard users can reach content without interactive elements.
- The indicator jumps instead of sliding when the user prefers reduced motion.