How to build an accessible Tabs in React

Implements the WAI-ARIA tabs pattern: tablist/tab/tabpanel roles with arrow-key navigation and Home/End, so the active tab and its panel are correctly associated for assistive tech

When to use a Tabs

When not to use it

Keyboard interactions

Role tablist, verified at WCAG 2.2-AA.

Common mistakes

Avoid: Using Tabs to toggle a single display option (e.g. grid/list view)

Prefer: <SegmentedControl> for view/setting toggles

Tabs imply switching content panels; toggling a parameter is a control, not navigation

Example

<Tabs defaultValue="account"><TabsList><TabsTrigger value="account">Account</TabsTrigger></TabsList><TabsContent value="account">…</TabsContent></Tabs>

See the full Tabs reference →