Foundation ComponentReact 18 & 19Zero Runtime CSS

Tabs

Related views with predictable focus, keyboard navigation and preserved panel state.

Interactive preview

Everything in one place.

Usage

import { Tabs } from "@devvy-ui/react";

<Tabs label="Project" defaultValue="general" items={[
  { value: "general", label: "General", content: <p>Details</p> },
  { value: "members", label: "Members", content: <p>Your team</p> },
]} />

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
itemsreadonly TabItem[]requiredUnique value, label, content and optional disabled.
labelstringrequiredAccessible name for the tab list.
value / defaultValuestringfirst enabledControlled or initial selection.
onValueChange(value: string) => void—Selection request callback.
activationModeautomatic | manualautomaticSelect on focus or Enter/Space.
orientationhorizontal | verticalhorizontalArrow key axis and layout.
dirltr | rtlltrExplicit direction; set this for RTL.

Accessibility & behavior

Platform Behavior & Guidelines

Arrow keys wrap and skip disabled tabs. Home/End jump to enabled boundaries. Hidden panels stay mounted. Missing or disabled selections display the first enabled item without firing a callback. Empty/all-disabled lists show no panel. Values must be unique. Intended for local panels, not route navigation.

Source ownership

Add the audited implementation directly into your repository with the CLI:

node /path/to/devvy-ui/packages/cli/src/cli.mjs add tabs

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

Tabs.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.