🔘Radio Button
Add radio button inputs for single-choice selections in Webstudio forms.
The Radio Button component creates an HTML radio input for selecting one option from a group.
Overview
Radio buttons are used when users must select exactly one option from a predefined set. Unlike checkboxes, selecting one radio button in a group automatically deselects any previously selected option.
Properties
name
string
Group name (same for all options)
value
string
Value submitted when selected
checked
boolean
Whether this option is selected
required
boolean
Whether a selection is required
disabled
boolean
Whether input is disabled
id
string
Unique identifier
class
string
CSS class names
Basic Usage
Radio Group
Radio buttons with the same name form a group:
Only one option can be selected at a time.
Important Rules
Same name: All radio buttons in a group must share the same
nameUnique values: Each option needs a unique
valueAt least one label: Each radio button needs an associated label
Styling Radio Buttons
Native Styling
Basic styling options:
accent-color: Change the selected colorwidth/height: Adjust sizecursor: pointer: Show clickable cursor
Custom Radio Buttons
For fully custom styling, consider using the Radix Radio Group component, which provides complete design control.
Form Submission
When the form is submitted, the selected option's value is sent:
If nothing is selected and the field is required, the form won't submit.
Default Selection
To pre-select an option, set checked: true:
Consider pre-selecting the most common choice.
Accessibility
Grouping
Properly group radio buttons:
Keyboard Navigation
Radio groups support keyboard navigation:
Arrow keys: Move between options
Space: Select focused option
Tab: Move to/from the group
Layout Patterns
Vertical Stack (Recommended)
Horizontal Row
Card Selection
States
Unchecked
Default unselected state
Checked
Selected state
Disabled
Cannot be interacted with
Focus
Keyboard focus visible
Best Practices
Use for mutually exclusive choices: Only when one option must be selected
Vertical layout: Easier to scan than horizontal
Logical order: Most common or recommended first
Clear labels: Self-explanatory option text
Default selection: Pre-select when there's a logical default
5-7 options max: Use select dropdown for more options
When to Use
2-7 mutually exclusive options
Multiple selections allowed
Many options (8+)
All options visible
Toggle single option
Space constrained
User needs to compare
Independent choices
Long option text
Related Components
Checkbox - Multiple selections
Select - Dropdown single selection
Radix Radio Group - Customizable radio buttons
Label - Associated labels
Form - Form container
Last updated
Was this helpful?
