Skip to main content

Radio Button

An input control that allows users to select only one option in a radio group.

Guidelines

When to Use

  • Use radio buttons when there is a list of two or more options and the user can select only one option.
  • Use radio buttons to allow users to easily see and compare available options.

When Not to Use

  • Do not use radio buttons when there is a list of options and the user may select any number of the choices. Use a checkbox instead.
  • Consider using a select instead of radio buttons when:
    • There are five or more options in a radio group, and space is constrained.
    • The options are familiar to users.

Selector Radio Button

Two Selector Radio Buttons for choosing shipping options.

Select

Two Select dropdowns for choosing country and state.
  • For a single option that can be turned on or off, use a stand-alone checkbox instead of two radio buttons.

Do

Example of correctly using a checkbox for an “I agree” confirmation.

Do Not

Using a radio button with “I agree” and “I do not agree” options.

Variants

Radio Button

Radio button variant. Unchecked is only an outline with gray 700.

Selector Radio Button

Selector Radio button variant with a border around the outside. Unchecked is only an outline with gray 600, no fill.

States

Radio Buttons and Selector Radio Buttons

Unchecked

  • Option is not selected.
Radio button variant. Unchecked is only an outline with gray 700.

Checked

  • Option is selected.
Radio button variant. Checked is colored blue 500 and partially filled.

Error

  • An error has occurred. See behavior section for error handling guidelines.
Radio button variant. Error state is error red and partially filled.

Skeleton

  • Use this state whenever data is being loaded to help establish a user's mental model of the component's shape and the page layout.
  • Use when the majority of page elements are loaded from API calls.
  • The skeleton is temporary and should disappear once the data is loaded.

Selector Radio Button

Hover

  • Visual feedback when a pointing device hovers over the option to show that it is selectable, it is only shown on the unchecked state.
Selector Radio button variant with a border around the outside. Hover is filled gray 150 and border is gray 900.

Usage

Radio Button with Label vs. Selector Radio Button

  • Use a selector radio button to show complex content.
  • Consider using a selector radio button when the options are longer than a few words, especially when they are sentences.

Radio Groups

  • Do not use the radio button with label and selector radio button in the same group.

Content

Label

  • Always include labels unless the context is sufficient and the design is reviewed by an accessibility expert.
  • Be concise and scannable. Consider using the selector radio button full variant when the options are longer than a few words, especially when they are sentences.
  • When the label is not a sentence, use title case without end punctuation.
  • When the label is a sentence, use sentence case with end punctuation.
  • When appropriate, change text weights and colors to highlight information.

Order of Options

  • List the options in a logical and meaningful order:
    • Most to least frequently selected
    • Positive to negative
    • Simplest to most complex
    • Safest to most risk
    • Numerical or alphabetical (Keep in mind that the alphabetical order will change when the labels are localized)
  • When appropriate, offer users the option to not make a selection. For example, include a “None” or “Other” option as the last option in a group.

Behavior

  • Radio buttons allow users to select only one option from a radio group.  
  • When an option in a radio group is known to be the most likely to be selected or is the suggested one, the option can be selected by default. In other cases, it is generally best practice to leave all options unchecked. This ensures that users review the options carefully and make an intentional choice. 
  • When the radio button is in an unchecked state and is selected, the state changes to checked.
  • When the radio button is in a checked state and is selected, the state does not change.
  • Selecting a radio button should not immediately implement the selection. A selection is implemented only if the entire form is submitted.

Field Set Level Error

  • When a selection is not made, a Critical Notification should display instructions on how to fix the error. Place the notification below the legend and above the radio group.

Legend

Field Set Level Error in the first row. Notification box above the radio buttons, filled with red 100 and a 2px error red outline. Notification message has exclamation point icon followed by error message. Item Level Error in the second row. Radio buttons without outline follow Field Set pattern with a partially-filled red radio button. When outline is present on radio buttons, exclamation point icon followed by red error text is placed below the radio button in the error state.

Legend

Field Set Level Error. Notification box above the radio buttons, filled with red 100 and a 2px error red outline. Notification message has exclamation point icon followed by error message.

Item Level Error

  • When the selection isn’t accepted, an error message should display instructions on how to fix the error.
    • Radio Button: Place a critical notification below the legend and above the radio group.
    • Selector Radio Button: Place the error message below the selected option.

Legend

Field Set Level Error in the first row. Notification box above the radio buttons, filled with red 100 and a 2px error red outline. Notification message has exclamation point icon followed by error message. Item Level Error in the second row. Radio buttons without outline follow Field Set pattern with a partially-filled red radio button. When outline is present on radio buttons, exclamation point icon followed by red error text is placed below the radio button in the error state.

Legend

Item Level Error. Radio buttons without outline follow Field Set pattern with a partially-filled red radio button. When outline is present on radio buttons, exclamation point icon followed by red error text is placed below the radio button in the error state.

Structure

Radio Button

  1. Radio Button: Positioned to the top left of its label.
  2. Label: Describes what the user is selecting.
Diagram showing Radio Button structure: 1. Radio Button icon on the left. 2. Label with T6 text to the right.

Selector Radio Button

  1. Radio Button
  2. Container
  3. Body: “Slot” that accepts a subcomponent of any type.
  4. Help link (optional)
  5. Icon
  6. Title
  7. Subtitle
  8. Input Body
Diagram showing Selector Radio Button structure: 1. Radio button on left. 2. 1px gray 600 outline container. 3. Body slot to the right that accepts aa subcomponent of any type. 4. Help link is positioned below the radio button aligned with radio button selector. 5. Icon. 6. Title. 7. Subtitle. 8. Input Body

Spacing

Options in a radio group should be vertically spaced 16px.

Example of both Radio Button and Selector Radio button spacing. 16px vertical spacing between each radio button, which includes the help link for Selector Radio button.

Native App Considerations

There are no Native App specific considerations for this component.

Accessibility

Keyboard Accessibility

[AC1] When there is a radio group on the page:

  • Focus can be moved to the current selected radio button using TAB. If a radio button has not been selected, focus moves to the first radio button in the group.

[AC2] When a radio button is in focus:

  • The focus indicator is clearly visible.
  • Focus can be moved between radio buttons using the arrow keys (LEFT ARROW/UP ARROW moves to the previous radio button, RIGHT ARROW/DOWN ARROW moves to the next radio button).

Screen Reader Output

[AC1] When a screen reader user presses DOWN ARROW into the radio group:

  • Name: The name of the radio group is announced.
  • The radio buttons are announced as a “group”.

Example Output: “Pizza Crust grouping”

  • Name: “Pizza Crust”

[AC2] When a screen reader user presses DOWN ARROW to an individual radio button:

  • Name: The label of the radio button is announced.
  • Role: The role of “radio button” is announced.
  • State: The current state (“checked”, “unchecked, or “selected”) is announced.

Example Output: “Stuffed crust radio button unchecked 2 of 3”

  • Name: “Stuffed crust”
  • Role: “radio button”
  • State: “unchecked”

[AC3] When a screen reader user presses DOWN ARROW is on an unselected radio button and presses SPACE:

  • State: The change in state (“Selected” or “Checked”) is announced.

[AC4] When focus is moved to a radio button in an error state:

  • Name: The name of the radio button is announced.
  • Role: The role of “radio button” is announced.
  • State: The current state (“checked”, “not checked”, “selected”) is announced.
  • The corresponding error message is announced.

Example Output: “Pick Up Kirkland Warehouse radio button checked 2 of 3 Invalid entry Error: Pick-Up is unavailable. Change your warehouse or select a different delivery method to continue Checkout.”

  • **Name: “**Pick Up Kirkland Warehouse”
  • Role: “Radio button”
  • State: “Invalid entry”, “checked”
  • Error Message: “Error: Pick-Up is unavailable. Change your warehouse or select a different delivery method to continue Checkout.”

Developer Notes

  • Use semantic HTML:
    • Use <fieldset> to group the radio buttons together.
    • Use <legend> for the group label.
    • Use <input type=”radio”> for each radio button.
    • Use <label> to label each radio button.
      • Make sure that the label is correctly referencing the radio button by adding the input ID to the label’s “for” attribute.
    • Add the “required” attribute to the fieldset if the radio group is required.
  • For custom components:
    • Use role=”radio” to indicate a radio button.
    • Use aria-label to add a label to each radio button.
    • Use aria-checked to express state.
    • Use role="radiogroup" to take the place of a <fieldset>.
    • Use aria-labelledby to associate an element as a label.
      • aria-label can also be used if there’s no label with an ID. 
  • Error states:
    • If the entire radio group is in error, add aria-invalid=”true” to the <fieldset> and add an aria-describedby to associate the error with the <fieldset>.
    • If an individual radio button is in error, add aria-invalid=”true” to the <input> and add an aria-describedby to associate the error with the <input>

In the Wild