Components
Tabs
Tabs organise content into separate views, allowing the user to switch between them.
Tab Content 1
Anatomy
Anatomy
import {Tabs} from '@staffbase/design';
<Tabs.Root>
<Tabs.List>
<Tabs.Trigger />
</Tabs.List>
<Tabs.Content />
</Tabs.Root> API reference
Root
Inherits props fromRadix UI Tabs Root
| Name | Type | Description |
|---|---|---|
value | string | The value of the selected tab when controlled. Use together with onValueChange. |
defaultValue | string | The value of the tab selected when initially rendered. Use when you do not need to control the selected tab. |
onValueChange | (value: string) => void | Callback fired when the selected tab changes. |
children | ReactNode | The tab list and content panels. |
List
Inherits props fromRadix UI Tabs List
| Name | Type | Description |
|---|---|---|
children | ReactNode | The tab triggers. |
Trigger
Inherits props fromRadix UI Tabs Trigger
| Name | Type | Description |
|---|---|---|
value | string | A unique value that associates the trigger with a content panel. |
children | ReactNode | The label shown inside the tab. |
Content
Inherits props fromRadix UI Tabs Content
| Name | Type | Description |
|---|---|---|
value | string | A unique value that associates the panel with its trigger. |
children | ReactNode | The content shown when the tab is selected. |
Examples
With badges
Inbox content