Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
Tabs ├── TabsList │ ├── TabsTrigger │ │ ├── TabsTriggerDescription (optional) │ │ └── TabsTriggerCount (optional) │ └── TabsIndicator (optional) └── TabsContent
Examples
Default
Loading...
Disabled
Loading...
Full Width
Loading...
Line
Loading...
Metric Tabs
Loading...
Secondary
Loading...
Sizes
Loading...
Stacked
Loading...
Vertical
Loading...
With Counts
Loading...
With Icons
Loading...
API Reference
Tabs
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | Unique identifier used to connect the component parts. |
ids | ElementIds | undefined | — | Overrides generated identifiers for individual parts. |
translations | IntlTranslations | undefined | — | Configures translations. |
loopFocus | boolean | undefined | — | Configures loop focus. |
value | string | null | undefined | — | Current value when the component is controlled. |
defaultValue | string | null | undefined | — | Initial value when the component is uncontrolled. |
orientation | "horizontal" | "vertical" | undefined | "horizontal" | Sets the component orientation and keyboard navigation axis. |
activationMode | "manual" | "automatic" | undefined | — | Configures activation mode. |
onValueChange | ((details: ValueChangeDetails) => void) | undefined | — | Runs when value changes. |
onFocusChange | ((details: FocusChangeDetails) => void) | undefined | — | Runs when focus changes. |
composite | boolean | undefined | — | Configures composite. |
deselectable | boolean | undefined | — | Configures deselectable. |
navigate | ((details: NavigateDetails) => void) | null | undefined | — | Configures navigate. |
size | "default" | "lg" | "default" | - |
variant | "default" | "line" | "primary" | "secondary" | "default" | - |
align | "center" | "start" | "start" | - |
layout | "inline" | "stacked" | "inline" | - |
Context, Hooks, and Types
| Export | API |
|---|---|
TabsContext | Render-prop component that exposes component state and actions. |
TabsRootProvider | Provides an externally created API to the component tree. |
useTabs | Creates or accesses the component API. |
useTabsContext | Returns the nearest component API. |
TabsValueChangeDetails | Type for the details object passed to the matching change callback. |
Utilities and Supporting Types
| Export | API |
|---|---|
tabsTriggerVariants | Style recipe used to reuse the component variants. |
tabsListVariants | Style recipe used to reuse the component variants. |
Angular
React
Solid
Svelte
Vue