radio component
Drop-in semantic component. See examples, sizes, variants, and source.
Single-choice picker built from a radio label that wraps a hidden
radio-input, a radio-box with a
radio-icon dot, and a radio-label.
Group multiple radios with radio-group,
radio-group-horizontal, or radio-stack;
promote individual options to selectable cards with radio-card.
Behavior is native — interactive enhancements live in radio.js.
Class API Reference
| Type | Class | Usage | Notes |
|---|---|---|---|
| Base | radio |
Outer label that wraps the input + box + label | Use a label element |
radio-input |
Visually hidden native input | Always required | |
radio-box |
Visible circle that reflects checked state | Required | |
radio-icon |
Inner dot that appears when checked | Place inside .radio-box |
|
radio-label / radio-description |
Text label and optional secondary description | Description sits beneath the label | |
| Sizes | xs |
14px box — tiny | Modifier on radio |
sm |
16px box — small | Modifier on radio |
|
| (default) | 20px box — medium | No size class needed | |
xl |
24px box — large | Modifier on radio |
|
lg |
28px box — big | Modifier on radio |
|
| Semantic Colors | primary |
Blue checked state | Modifier on radio |
positive |
Green checked state | Modifier on radio |
|
negative |
Red checked state | Modifier on radio |
|
warning |
Orange checked state | Modifier on radio |
|
info |
Blue checked state (alias for primary) | Modifier on radio |
|
red orange yellow olive green teal blue violet purple pink brown grey black |
Extended palette checked colors | Decorative; prefer semantic names | |
| Variants / States | soft |
Tinted background instead of solid checked color | Modifier on radio |
error |
Red border, label, and focus ring | Modifier on radio |
|
flip |
Move the box to the right of the label | Modifier on radio |
|
| Radio Card | radio-card |
Card-shaped radio with title, description, and badge | Use a label element |
radio-card-content |
Wrapper for title + description | Inside .radio-card |
|
radio-card-title / radio-card-description |
Card text rows | Inside .radio-card-content |
|
radio-card-badge |
Right-aligned pill (price, tag) | Inside .radio-card |
|
| Groups | radio-group |
Vertical stack of radios | Use a fieldset |
radio-group-horizontal |
Wrapping flex row of radios | Use a fieldset |
|
radio-group-compact |
Tighter vertical stack with reduced gap | Use a fieldset |
|
radio-stack |
Card list — each radio becomes a separated row | Wrap with a bordered container |