Arcana UI
Components

Tabs

Tabbed navigation for switching between content panels. Keyboard navigable, WAI-ARIA compliant.

Import

import { Tabs, TabList, Tab, TabPanel } from '@arcana-ui/core'

Usage

<Tabs defaultValue="overview">
  <TabList>
    <Tab value="overview">Overview</Tab>
    <Tab value="analytics">Analytics</Tab>
    <Tab value="settings">Settings</Tab>
  </TabList>
  <TabPanel value="overview">
    <p>Overview content here.</p>
  </TabPanel>
  <TabPanel value="analytics">
    <p>Analytics charts here.</p>
  </TabPanel>
  <TabPanel value="settings">
    <p>Settings form here.</p>
  </TabPanel>
</Tabs>

Controlled

const [tab, setTab] = useState('overview')
 
<Tabs value={tab} onValueChange={setTab}>
  <TabList>
    <Tab value="overview">Overview</Tab>
    <Tab value="analytics">Analytics</Tab>
  </TabList>
  <TabPanel value="overview">...</TabPanel>
  <TabPanel value="analytics">...</TabPanel>
</Tabs>

Props

Tabs

PropTypeDefaultDescription
defaultValuestringInitial active tab (uncontrolled)
valuestringActive tab (controlled)
onValueChange(value: string) => voidCalled when tab changes
variant'line' | 'pills' | 'enclosed''line'Visual style
classNamestringAdditional CSS classes

Tab

PropTypeDefaultDescription
valuestringTab identifier
disabledbooleanfalseDisable this tab
childrenReact.ReactNodeTab label

TabPanel

PropTypeDefaultDescription
valuestringAssociated tab value
childrenReact.ReactNodePanel content

Disabled tabs

<Tab value="billing" disabled>Billing (coming soon)</Tab>

Accessibility

  • TabList has role="tablist"
  • Each Tab has role="tab" with aria-selected and aria-controls
  • Each TabPanel has role="tabpanel" with aria-labelledby
  • Arrow keys navigate between tabs
  • Home/End jump to first/last tab
  • Inactive panels are hidden with aria-hidden and display: none
  • Accordion — collapsible sections (alternative to tabs for longer content)

On this page