Tabs

Horizontal tab navigation with full keyboard support (arrow keys, Home, End).

Controlled

import { useState } from 'react'
import { Tabs } from '@canarist/ui'

const tabs = [
  { id: 'overview', label: 'Overview' },
  { id: 'alerts', label: 'Alerts' },
  { id: 'settings', label: 'Settings' },
]

function Example() {
  const [active, setActive] = useState('overview')
  return <Tabs tabs={tabs} activeTab={active} onChange={setActive} />
}

Reference

PropTypeDefaultDescription
tabs{ id: string; label: string }[]Array of tab definitions.
activeTabstringID of the currently active tab.
onChange(id: string) => voidCalled when the user selects a tab.
classNamestringAdditional CSS classes on the tablist container.