Components

Tabs

Tabs organise content into separate views, allowing the user to switch between them.

Stable
GitHub
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 fromBase UI Tabs Root

Groups all parts of the tabs and manages which tab is selected.

NameTypeDescription
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

Renders the container that lays out the tab triggers.

NameTypeDescription
children
ReactNode
The tab triggers.

Trigger

Inherits props fromBase UI Tabs Tab

Renders the button that activates its associated content panel.

NameTypeDescription
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

Renders the panel shown when its associated trigger is selected.

NameTypeDescription
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