Tabs
A set of layered content panels, known as Tab Panels, displayed one at a time.
Examples
Standalone (Outside the Header)
Tabs with limited width, ideal for cards or content sections.
Preview
Conteúdo da Home
Header (Inside the Header)
Tabs that span the full width, ideal for primary page navigation.
Preview
Conteúdo da Visão Geral
With Icons
Tabs can include icons to improve visual identification.
Preview
Conteúdo da Home
With Badges
Tabs can include badges to indicate counts or status.
Preview
Mensagens recebidas
Sizes
Tabs are available in sizes md and lg.
Preview
Size: md
Size: lg
Customization
Each element can be customized individually through CSS classes.
Preview
Conteúdo customizado
Non-Responsive
Disable responsive behavior to keep a fixed size across all screens.
Preview
Conteúdo 1
With Disabled Tab
Tabs can be disabled to prevent user interaction.
Preview
Conteúdo das tarefas ativas
API
Tabs Structure
| Component | Description | Usage |
|---|---|---|
| Tabs | Root component that manages tab state | Contains all other tab components |
| TabsList | Container for the tab triggers | Groups the tab navigation buttons |
| TabsTrigger | Clickable button for each tab | Activates the corresponding content panel |
| TabsContent | Content panel for each tab | Shown when the corresponding tab is active |
Tabs
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| defaultValue | string | Any string | - | The tab value that should be active by default. |
| value | string | Any string | - | The controlled value of the active tab. |
| onValueChange | (value: string) => void | - | - | Callback called when the tab value changes. |
| variant | ”header” | “standalone" | "header”, “standalone" | "standalone” | Defines whether tabs take full width (header) or limited width (standalone). |
| size | ”md” | “lg" | "md”, “lg" | "md” | Size of the tabs. |
| responsive | boolean | true, false | true | Enables responsive behavior that adjusts size on mobile/tablet. |
| className | string | Any CSS class | - | Additional CSS classes for customization. |
TabsList
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| className | string | Any CSS class | - | Additional CSS classes for customization. |
TabsTrigger
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| value | string | Any string | - | Unique value that identifies the tab. |
| icon | React.ReactNode | Any React node | - | Icon displayed before the tab text. |
| badge | React.ReactNode | Any React node | - | Badge displayed after the tab text. |
| disabled | boolean | true, false | false | Disables interaction with the tab. |
| className | string | Any CSS class | - | Additional CSS classes for customization. |
TabsContent
| Property | Type | Possible Values | Default | Description |
|---|---|---|---|---|
| value | string | Any string | - | Unique value that links the content to its tab. |
| forceMount | boolean | true, false | false | Forces content to stay mounted even when inactive. |
| className | string | Any CSS class | - | Additional CSS classes for customization. |
Accessibility
The Tabs component follows the WAI-ARIA pattern for tabs:
- Uses
role="tablist",role="tab"androle="tabpanel"appropriately - Supports keyboard navigation (arrows, Tab, Enter, Space)
- Manages
aria-selectedandaria-controlsautomatically - Inactive content is removed from the DOM by default (use
forceMountif needed)
Last updated on