navigationbuilt on ui sdk
Tabs
Switches between panels. Selected tab underlined in the accent.
Color, type and spacing stored as data.
01 / usage
import { Tabs, TabsList, TabsTab, TabsPanel } from '@mikestecker/strata/ui'
import { Tabs, TabsList, TabsPanel, TabsTab } from '@mikestecker/strata/ui'
export default function TabsDemo() {
return (
<Tabs defaultValue="tokens">
<TabsList aria-label="Layers">
<TabsTab value="tokens">tokens</TabsTab>
<TabsTab value="components">components</TabsTab>
<TabsTab value="agents">agents</TabsTab>
</TabsList>
<TabsPanel value="tokens">Color, type and spacing stored as data.</TabsPanel>
<TabsPanel value="components">The React library product teams ship with.</TabsPanel>
<TabsPanel value="agents">Where coding agents read the rules.</TabsPanel>
</Tabs>
)
}02 / parts
TabsTabsListTabsTabTabsPanel
03 / keyboard
- Tab enters the list at the selected tab.
- Left and Right Arrow move and select; Home and End jump to the ends.
04 / agents
An agent selects a tab by its text. Give the list an aria-label.