Tabs
Related views with predictable focus, keyboard navigation and preserved panel state.
Interactive preview
Everything in one place.
Your project is ready to build.
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:
| Prop | Type | Default | Description |
|---|---|---|---|
| items | readonly TabItem[] | required | Unique value, label, content and optional disabled. |
| label | string | required | Accessible name for the tab list. |
| value / defaultValue | string | first enabled | Controlled or initial selection. |
| onValueChange | (value: string) => void | — | Selection request callback. |
| activationMode | automatic | manual | automatic | Select on focus or Enter/Space. |
| orientation | horizontal | vertical | horizontal | Arrow key axis and layout. |
| dir | ltr | rtl | ltr | Explicit 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 tabsMake 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.
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.