Tabs
Switch between views of the same thing without leaving the page.
Website refresh
ActiveDesign studio ยท Updated today
When to use it
Use Tabs for a few views of one subject, such as a projectโs overview, activity, and settings. People should never need two tabs open at once.
Keep labels to a word or two, and keep the tab count small enough to fit without scrolling.
Sidebar
Where you are in the app.
Room to focus
Toggle the live navigation.
The main sections of an app.
TabsThis page
Views of one thing.
Website refresh
ActiveDesign studio ยท Updated today
Overview, activity, and settings.
How it behaves
Arrow keys navigate tabs. Activation is automatic by default; Base UI also supports activateOnFocus={false} on TabsList.
Give the tab list a label. Each trigger is connected to its panel. Disabled tabs remain focusable in Base UI but cannot activate.
Panels unmount by default. Keep form values in parent state if they must survive tab changes.
Pointer selection moves the indicator in 220ms; keyboard and reduced-motion selection are immediate. Use animated={false} on TabsList to disable movement.
Build it
Add it with the shadcn CLI:
1pnpm dlx shadcn@latest add https://jzbui.com/r/tabs.jsonA complete example. Change the values to fit your product:
12345678910import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
<Tabs defaultValue="overview"> <TabsList aria-label="Project sections"> <TabsTrigger value="overview">Overview</TabsTrigger> <TabsTrigger value="activity">Activity</TabsTrigger> </TabsList> <TabsContent value="overview">Project overview.</TabsContent> <TabsContent value="activity">Your project is up to date.</TabsContent></Tabs>The full source is yours to edit once installed: