ComponentsMarkdown
Radio
Mutually exclusive choice controls built on Radix RadioGroup. RadioGroup renders a <fieldset> and <legend> with arrow-key navigation across Radio items.
Live example
Props
RadioGroup props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | required | Group heading rendered inside <legend>. |
| description | ReactNode | — | Helper text wired into aria-describedby. |
| error | ReactNode | — | Error text rendered with role="alert" and wired to aria-invalid. |
| orientation | "vertical" | "horizontal" | "vertical" | Stack direction and arrow-key orientation. |
| size | "xs" | "sm" | "md" | "lg" | "md" | Default control size inherited by child Radio items. |
| name | string | — | Submits the selected value in native HTML forms via FormData. |
Radio props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string | required | Unique value submitted when this option is selected. |
| label | ReactNode | — | Inline label rendered to the right of the radio circle; makes the entire row clickable. |
| description | ReactNode | — | Optional helper text wired into aria-describedby. |
| size | "xs" | "sm" | "md" | "lg" | Group size | Radio circle size (--control-icon-*) and minimum clickable row height (--control-height-*). |
| disabled | boolean | false | Disables selection using step 3 background and step 8 text without opacity. |
Sizes and tokens
| Tier / Role | Token | Value |
|---|---|---|
| xs | --control-icon-xs / --control-height-xs | 16px circle · 8px dot · 24px row min-height |
| sm | --control-icon-sm / --control-height-sm | 16px circle · 8px dot · 32px row min-height |
| md | --control-icon-md / --control-height-md | 20px circle · 8px dot · 40px row min-height |
| lg | --control-icon-lg / --control-height-lg | 24px circle · 12px dot · 48px row min-height |
| Unchecked / Checked | --input / --primary | Step 8 border · 2px brand step 9 ring + solid dot when selected |
States
Code
import { Radio, RadioGroup } from "@freshgemui/monoplinth";
export function Example() {
return (
<RadioGroup name="plan" label="Plan" defaultValue="pro" required>
<Radio value="free" label="Free" description="Up to 3 workspaces." />
<Radio value="pro" label="Pro" description="Unlimited workspaces." />
</RadioGroup>
);
}Do and don't
Do: Keep radio options concise and mutually exclusive
Use RadioGroup when the user must pick exactly one option from a small, visible list.
Don't: Use Radio for independent toggles or long lists
Use Checkbox or Switch for independent boolean settings, and Select when there are more than five options.
Accessibility
RadioGrouprenders a<fieldset>+<legend>withrole="radiogroup", wiringdescriptionanderrorviaaria-describedbyandaria-invalid.- Arrow keys (
ArrowUp,ArrowDown,ArrowLeft,ArrowRight) move focus and selection across enabled options;Tabenters and leaves the group as a single stop. - Every
Radiorow enforces--control-height-*minimum target height (≥ 24px).
Rationale
Sharing ChoiceRow with Checkbox and Switch keeps row alignment, target sizing, and description wiring uniform across all choice controls.