Atoms
Tabs
Tabbed navigation built on Radix UI.
shadcn/uiBased on shadcn/ui with Formance brand styling.
Line#
Use variant="line" for an underlined tab style. Triggers can carry trailing count chips — handy for showing how many items each tab holds.
Vertical#
Set orientation="vertical" to stack the triggers beside the content.
Scroll#
Set scroll on TabsList when the triggers can be wider than the container. The list is then never wider than its container, and it scrolls horizontally. The triggers do not shrink and do not wrap. Use it with the horizontal orientation only.
Case sensitive#
By default, the labels are in uppercase. Set caseSensitive on a trigger to keep the case of its label, for example a file name.
Installation#
npx shadcn@latest add @formance/tabsInstall the following dependencies:
npm install radix-ui class-variance-authorityCopy and paste the following code into your project.
Update the import paths to match your project setup.
Usage#
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'<Tabs defaultValue="transactions"> <TabsList> <TabsTrigger value="transactions">Transactions</TabsTrigger> <TabsTrigger value="accounts">Accounts</TabsTrigger> <TabsTrigger value="metadata">Metadata</TabsTrigger> </TabsList> <TabsContent value="transactions"> Browse and filter all ledger transactions. </TabsContent> <TabsContent value="accounts"> View account balances and details. </TabsContent> <TabsContent value="metadata"> Inspect and edit transaction metadata. </TabsContent></Tabs>API reference#
Tabs#
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | The direction of the triggers. |
...props | TabsPrimitive.Root props | - | Props given to the Radix Tabs.Root. |
TabsList#
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "line" | "default" | The visual treatment. |
scroll | boolean | false | Horizontal orientation only. The list is never wider than its container and scrolls when its triggers do not fit. |
...props | TabsPrimitive.List props | - | Props given to the Radix Tabs.List. |
TabsTrigger#
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Required. The value of the tab that the trigger opens. |
caseSensitive | boolean | false | Keep the case of the label. By default, the label is in uppercase. |
...props | TabsPrimitive.Trigger props | - | Props given to the Radix Tabs.Trigger. |