Radio

Native radios with consistent spacing, focus and validation.

When to use

Use radios when a user can select exactly one option from a visible group, such as a delivery method or billing interval. Use Checkbox for independent choices that allow several selections, or Select when the options should appear in a compact dropdown.

Radio group

Combine .form-check with native type="radio" inputs using .form-check-input. Give the inputs the same name and distinct value attributes inside a fieldset named by its legend. Connect each visible label with matching for and id attributes; use checked for the initial selection.

Choose an option
HTML
<fieldset class="border border-0 min-w-0">
	<legend class="mb-2">Choose an option</legend>

	<div class="d-flex flex-column gap-2">
		<div class="form-check">
			<input
				class="form-check-input"
				id="radioGroupOne"
				name="radioGroup"
				type="radio"
				value="option-one"
				checked />
			<label class="form-label" for="radioGroupOne">Option one</label>
		</div>

		<div class="form-check">
			<input
				class="form-check-input"
				id="radioGroupTwo"
				name="radioGroup"
				type="radio"
				value="option-two" />
			<label class="form-label" for="radioGroupTwo">Option two</label>
		</div>

		<div class="form-check">
			<input
				class="form-check-input"
				id="radioGroupThree"
				name="radioGroup"
				type="radio"
				value="option-three" />
			<label class="form-label" for="radioGroupThree">Option three</label>
		</div>
	</div>
</fieldset>

Invalid

Combine .is-invalid and aria-invalid="true". Link every radio to feedback after the final .form-check with aria-describedby.

Choose an option

Please select one option.

HTML
<fieldset class="border border-0 min-w-0">
	<legend class="mb-2">Choose an option</legend>

	<div class="form-check">
		<input
			class="form-check-input is-invalid"
			id="radioInvalidOne"
			name="radioInvalid"
			type="radio"
			value="option-one"
			aria-invalid="true"
			aria-describedby="radioInvalidFeedback" />
		<label class="form-label" for="radioInvalidOne">Invalid option one</label>
	</div>

	<div class="form-check">
		<input
			class="form-check-input is-invalid"
			id="radioInvalidTwo"
			name="radioInvalid"
			type="radio"
			value="option-two"
			aria-invalid="true"
			aria-describedby="radioInvalidFeedback" />
		<label class="form-label" for="radioInvalidTwo">Invalid option two</label>
	</div>

	<div class="invalid-feedback" id="radioInvalidFeedback">Please select one option.</div>
</fieldset>

Disabled

Use the native disabled attribute to prevent an option from being selected or submitted.

HTML
<div class="form-check">
	<input class="form-check-input" id="radioDisabled" name="radioDisabled" type="radio" disabled />
	<label class="form-label" for="radioDisabled">Disabled radio</label>
</div>

Accessibility and behavior

  • Use fieldset and legend to name the group, and keep a visible label connected to each input. Clicking a label selects its radio and increases the usable target area.
  • Keep the same name for mutually exclusive options and use a different name for each separate group in the same form. Selecting an option clears the previous selection in its group.
  • Tab and Shift+Tab move into and out of the group. Within a group, the arrow keys move focus and selection between enabled options; Space selects the focused radio. Preserve native keyboard behavior and the visible focus indicator.
  • Only the checked, enabled radio contributes its name and value to native form submission. A group with no selection contributes no entry. Add native required to a radio when the group must have a selection; see Form.
  • Connect hints and errors with aria-describedby. .is-invalid styles an error and aria-invalid communicates it; neither performs validation. Update these states and the feedback when application validation changes.

CSS variables

Override these base defaults on the listed selector after the library styles. Variants and states may replace them; global tokens follow the active theme.

TokenDefaultPurposeScope / state
--form-check-gapvar(--spacer-2)Space between the input and label..form-check
--form-check-input-size1remCheckbox or radio width and height..form-check-input
--form-check-input-border-radiusvar(--border-radius-sm, 0.25rem)Checkbox corner radius; radios remain circular..form-check-input
--form-check-input-bg-colorvar(--bg-surface)Unchecked control background..form-check-input
--form-check-input-border-widthvar(--border-width)Control border thickness..form-check-input
--form-check-input-border-colorvar(--control-border-color)Unchecked control border..form-check-input
--form-check-input-checked-bg-colorvar(--primary)Checked or indeterminate background..form-check-input (checked / indeterminate)
--form-check-input-checked-border-colorvar(--primary)Checked or indeterminate border..form-check-input (checked / indeterminate)
--form-check-input-checked-colorvar(--on-primary)Checkmark, indeterminate bar or radio dot color..form-check-input (checked / indeterminate)
--form-check-disabled-bg-colorvar(--disabled-bg-color)Background color while disabled..form-check-input (disabled)
--form-check-disabled-border-colorvar(--disabled-border-color)Border color while disabled..form-check-input (disabled)
--form-check-transition-durationvar(--transition-duration)Duration of visual state transitions..form-check
--form-check-transition-easingvar(--transition-easing)Timing curve for visual state transitions..form-check