Components
Tabs
Tabs organise content into separate views, allowing the user to switch between them.
Stable
GitHubTab 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 fromBase 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 fromBase UI Tabs List
| Name | Type | Description |
|---|---|---|
children | ReactNode | The tab triggers. |
Trigger
Inherits props fromBase UI Tabs Tab
| 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 fromBase UI Tabs Panel
| 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
When to use
When not to use
How to use
Structure
Tab Content 1
Badges
Inbox content
Accessibility
Content & UX copy
Do
Title Case labels.
Don't
Lowercase labels.
Do
All nouns in the same tab group.
Don't
Mixed nouns and verbs in the same tab group.