Fieldset
RequiredSemantic group and disabled boundary.
fieldsetFields & selection
A controlled fieldset for selecting exactly one value from a small, visible option set.
RadioGroupRadioGroupPropsRadioOptionConfigure the production component, inspect it at responsive widths, copy synchronized JSX, and share the exact state from one workspace.
This JSX stays synchronized with the controls and uses only public package APIs.
'use client';
import { useState } from 'react';
import { RadioGroup } from '@ai-created/ui';
const options = [
{ value: 'design', label: 'Design' },
{ value: 'engineering', label: 'Engineering' },
{ value: 'research', label: 'Research' },
];
export function Example() {
const [value, setValue] = useState("design");
return (
<RadioGroup
options={options}
value={value}
onChange={setValue}
legend="Team discipline"
/>
);
}
import { RadioGroup, type RadioOption } from '@ai-created/ui';Replace the version placeholder with the release tag your product has reviewed.
npm install --install-links "git+https://github.com/TheMarco/ai-created-ui.git#vX.Y.Z"@import '@ai-created/ui/styles/tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
presets: [require('@ai-created/ui/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@ai-created/ui/src/**/*.{js,ts,jsx,tsx}',
],
};Named regions define what belongs to the component, what remains optional, and where semantic responsibility lives.
Semantic group and disabled boundary.
fieldsetPersistent group name.
legendVisually hidden option input.
input[type=radio]16px circular selection mark.
Visible name and 44px minimum row target.
labelThe Figma-equivalent asset model, auto-layout, resizing, properties, slots, content bounds, localization, and governance contract.
Asset kind
component
Design library name
Components/Forms/Radio group
Maturity
stable
Last reviewed
2026-08-29
Canvas applicability
Publish vertical and horizontal group variants with nested option instances.
| Property | Type | Default | Code mapping | Options or notes |
|---|---|---|---|---|
| Orientation | variant | vertical | orientation | vertical, horizontal |
| Selected valueRequired | variant | None | value | No additional constraint |
| Disabled | boolean | false | disabled | No additional constraint |
| LegendRequired | text | Choose one | legend | No additional constraint |
| OptionsRequired | slot | None | options | No additional constraint |
Semantic group boundary.
<fieldset>Group question or name.
<legend>Repeatable native radio, indicator, and label.
RadioOption data itemOverflow: Use Dropdown or a searchable picker for larger sets.
All choices should be comparable without excessive scanning.
Overflow: Wrap and align indicator with the first line.
Peer choices need parallel, concise wording.
Translatable: Legend, Option labels
Vertical is the safe default.
Parent-selected narrow breakpoint
Accountable owner
Design systems form foundations owner
Canonical source: src/components/RadioGroup.tsx
These measurements and semantic tokens define the supported visual contract. Local overrides should preserve the same hierarchy and interaction cues.
Option row minimum height
44px
Indicator
16 × 16px
Selected dot
9.6 × 9.6px
Indicator/label gap
10px
Vertical option gap
10px
Horizontal option gap
16px
--color-action-primarySelected indicator.
--color-on-actionSelected inner mark.
--color-control-border / --color-control-border-strongUnselected and hover boundary.
--color-focusPeer focus outline.
--color-text2Legend and option labels.
A component is not complete until its passive, interactive, disabled, and exceptional states remain understandable in both themes.
Semantics, accessible naming, keyboard behavior, focus and announcements are implementation requirements, not optional documentation.
Use the public package API and preserve the controlled-state, native-attribute, and ref contracts described below.
import { RadioGroup, type RadioOption } from '@ai-created/ui';Server Component compatible
<RadioGroup options={options} value={size} onChange={setSize} legend="Size" />These props and helpers are compatibility contracts. Changes require migration guidance and release notes.
| Prop | Type | Default | Contract |
|---|---|---|---|
| options | RadioOption<T>[] | required | Options with value, label, and optional disabled. |
| value | T | required | Controlled selected value. |
| onChange | (value: T) => void | required | Called when selection changes. |
| legend | string | required | Fieldset legend. |
| name | string | generated id | Native radio group name. |
| disabled | boolean | false | Disables the group. |
| orientation | horizontal | vertical | vertical | Option layout. |
These rules keep the component recognizable across products without preventing deliberate composition.
The component should be verified as rendered UI, an interaction model, an accessibility surface, and a theme-aware visual artifact.