RadioGroup
Native single-choice inputs, validation and form reset.
Interactive preview
Usage
import { RadioGroup } from "@devvy-ui/react";
<RadioGroup label="Plan" name="plan" defaultValue="team" items={[{value:"solo",label:"Solo"},{value:"team",label:"Team",description:"For shared projects"}]} />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 | Legend and unique value/label options. |
| value / defaultValue / onValueChange | string / string / callback | — | Controlled or initial native selection. |
| name / required / disabled | native form attributes | — | Form submission, validation and availability. |
| orientation | vertical | horizontal | vertical | Visual arrangement. |
Accessibility & behavior
Platform Behavior & Guidelines
A native fieldset and radio inputs retain browser arrow-key behavior, form/reset and disabled semantics. Option descriptions are connected with aria-describedby. A form attribute is forwarded to the actual inputs too. Controlled values require caller updates; preserve meaningful legends and unique values.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add radio-groupMake 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.