SegmentedControl
A compact, form-aware single-choice group.
Interactive preview
Billing: monthly
Usage
import { SegmentedControl } from "@devvy-ui/react";
<SegmentedControl label="Billing" name="billing" defaultValue="monthly" items={[{value:"monthly",label:"Monthly"},{value:"yearly",label:"Yearly"}]} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| label / items | ReactNode / readonly RadioItem[] | required | Group legend and options. |
| value / defaultValue / onValueChange | RadioGroup selection props | — | Controlled or native initial selection. |
| name / required / disabled | native form attributes | — | Native radio semantics. |
Accessibility & behavior
Platform Behavior & Guidelines
Composes RadioGroup with compact horizontal styling; source mode includes that dependency. Native radios remain focusable and form-aware. Arrow keys follow browser radio behavior, including RTL. This chooses a value; use Tabs for tab panels and links for route navigation.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add segmented-controlMake 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.