Browse the docs
Display / Tabs

Tabs

Index-card dividers. The active one comes forward and joins the page. Arrow keys move between them.

Client componentWCAG AASince v0.1
Flooding, Purok 4 · Road accident, Maharlika Hwy · Noise complaint, Brgy. 3

Change every prop live in the playground.

Props

Tabs

PropTypeDefaultWhat it does
children requiredReactNode——
classNamestringnone—
defaultValuestringnone—
onValueChange(value: string) => voidnone—
valuestringnone—

TabList

PropTypeDefaultWhat it does
children requiredReactNode——
label requiredstring—Accessible name of the tab list, e.g. "Incident queue".
classNamestringnone—

Tab

PropTypeDefaultWhat it does
children requiredReactNode——
value requiredstring——
badgeReactNodenoneA count badge after the label (e.g. a <Count>).
disabledbooleanfalse—

Use it well

DoUse tabs to switch between views of the same thing.
Don'tUse tabs as steps in a process. People can't tell they have to visit each one.

Accessibility

  • The WAI-ARIA tabs pattern: tablist, tabs with aria-selected and aria-controls, tabpanels.
  • Roving tabindex; Arrow keys, Home and End move and select.
Five stamps!

All aboard.

You took the whole tour. Here's Holo Pip, a foil sticker for riders who finish. It's in your playground tray now, for good.