Tabs
Tabs on Base UI with a raised thumb or a line underline that springs to the active tab, optional count badges, vertical orientation and roving keyboard focus.
src/registry/ui/tabs.tsx/r/tabs.json
NL
Northwind Labs
billing@northwind.io · Customer since March 2024
INV-2041Sep 24$12,400Paid
INV-2033Sep 2$3,890Pending
INV-2019Aug 24$12,400Paid
INV-2004Jul 30$890Overdue
Revenue
$48,210
+12.4% vs previous period
Click or arrow between tabs
Default with a badge, line
Installation#
bash
npx shadcn@latest add @minidev/tabs
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/tabs.json
Usage#
tsx
import { Tabs } from "@/components/ui/tabs"
export function Example() {
return (
<Tabs defaultValue="overview" className="w-full">
<div className={scroll}>
<TabsList>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="invoices" badge={12}>Invoices</TabsTrigger>
<TabsTrigger value="activity">Activity</TabsTrigger>
<TabsTrigger value="settings" disabled>Settings</TabsTrigger>
</TabsList>
</div>
<TabsContent value="overview" className={panel}>Overview for the Lumen workspace.</TabsContent>
<TabsContent value="invoices" className={panel}>12 invoices issued this month.</TabsContent>
<TabsContent value="activity" className={panel}>Recent activity.</TabsContent>
</Tabs>
)
}
API reference#
Also accepts every prop of TabsPrimitive.Root props, passed through to the root element.
Dependencies#
npm
@base-ui/reactclass-variance-authoritymotion
Built from
No other MiniDev files
Examples#
Related navigation components#
Back LinkSmall back navigation link with a left arrow icon, muted text that darkens on hover and a visible focus ring. Defaults to the label Back and accepts any href.Breadcrumb EllipsisEllipsis marker for collapsing the middle of long breadcrumb trails. Decorative and hidden from assistive tech, sized to sit between breadcrumb separators.BreadcrumbBreadcrumb navigation from an items array, with chevron separators, linked ancestors and the current page marked with aria-current. Built with React.Collapsible SidebarSidebar with a toggle button on its edge that collapses it to a narrow rail and expands it again. The button label updates for screen readers.Command ItemRow for command menus with a label, an optional keyboard shortcut in a kbd tag and an active highlight state. Use it to build custom command lists.Command PaletteCmd K style command palette in a dialog with a search field that filters commands as you type, runs the chosen action and closes. Shows an empty state.
All navigation components