| title | Tabs |
|---|---|
| description | A set of layered sections of content that display one panel at a time. |
| source | packages/raystack/components/tabs |
import { preview, basicDemo, iconsDemo, disabledDemo, variantsDemo, sizesDemo } from "./demo.ts";
Import and assemble the component:
import { Tabs } from "@raystack/apsara";
<Tabs>
<Tabs.List>
<Tabs.Tab />
</Tabs.List>
<Tabs.Content />
</Tabs>Groups all parts of the tabs component.
Renders the tab navigation bar.
Renders an individual tab button.
Renders the content panel for a tab.
- Follows the WAI-ARIA Tabs pattern
- Supports keyboard navigation with arrow keys between tabs
- Uses
role="tablist",role="tab", androle="tabpanel" - Active tab is indicated with
aria-selected - Leading icon is wrapped with
aria-hiddenso it is not announced (treated as decorative) - Respects motion preferences: tab indicator motion is enabled only when
prefers-reduced-motion: no-preference