Tabs

Accessible tabbed interface with keyboard navigation.

Import

import { Tabs } from '@adjanour/react-components'
import '@adjanour/react-components/tabs.css'

Live Example

Usage

<Tabs
  tabs={[
    { label: 'Overview', content: <p>Overview content</p> },
    { label: 'Usage', content: <p>Usage instructions</p> },
    { label: 'API', content: <p>API reference</p> },
  ]}
/>

Props

PropTypeDefaultDescription
tabsTab[]RequiredArray of { label, content }
defaultIndexnumber0Initially active tab

Behavior

Theming

VariableDefaultDescription
--aw-tabs-border#e2e8f0Tablist bottom border
--aw-tabs-text#475569Inactive tab text
--aw-tabs-active-text#0f172aActive tab text
--aw-tabs-active-border#3b82f6Active tab underline
--aw-tabs-hover-bg#f8fafcTab hover background
--aw-tabs-radius6pxFocus ring radius