v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

RadioGroup

Native single-choice inputs, validation and form reset.

Interactive preview

Workspace plan

Selected plan: team

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:

PropTypeDefaultDescription
label / itemsReactNode / readonly RadioItem[]requiredLegend and unique value/label options.
value / defaultValue / onValueChangestring / string / callback—Controlled or initial native selection.
name / required / disablednative form attributes—Form submission, validation and availability.
orientationvertical | horizontalverticalVisual 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-group

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.

RadioGroup.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.