TabsA set of layered sections of content that display one panel at a time.
The Tabs component provides a way to organize content into multiple sections, displaying one section at a time.
Install the component from your command line.
The Tabs component is composed of several parts, each with their own props:
Tabs follow the WAI-ARIA Tabs Pattern. They include the following accessibility features:
General settings content
npm install @raystack/apsara
import { Tabs } from '@raystack/apsara/v1' <Tabs.Root defaultValue="tab1"> <Tabs.List> <Tabs.Trigger value="tab1">Tab One</Tabs.Trigger> <Tabs.Trigger value="tab2">Tab Two</Tabs.Trigger> </Tabs.List> <Tabs.Content value="tab1">Tab one content</Tabs.Content> <Tabs.Content value="tab2">Tab two content</Tabs.Content> </Tabs.Root>
defaultValue
: The initial active tab value. If not passed, no tab will be selected by default.value
: Controlled active tab value.onValueChange
: Callback when active tab changes.className
: Additional CSS class names.
className
: Additional CSS class names
value
: Unique identifier for the tab (required)icon
: Optional icon element to displaydisabled
: Whether the tab is disabledclassName
: Additional CSS class names
value
: Matching identifier for the tab (required)className
: Additional CSS class names
loading...
loading...
loading...
- Keyboard navigation between tabs using arrow keys
- Proper ARIA roles, states, and properties
- Focus management for tab panels