Radio button

Use radio buttons to present each item in a list of options where merchants must make a single selection.

Examples

Use radio buttons where merchants must make a single selection.

Drag to resize example

Props

checked
boolean
Radio button is selected
disabled
boolean
Disable input
helpText
React.ReactNode
Additional text to aid in use
id
string
ID for form input
labelRequired
React.ReactNode
Label for the radio button
labelHidden
boolean
Visually hide the label
name
string
Name for form input
value
string
Value for form input
onBlur
() => void
Callback when focus is removed
onChange
(newValue: boolean, id: string) => void
Callback when the radio button is toggled
onFocus
() => void
Callback when radio button is focussed

Accessibility

Screen readers convey the state of the radio button automatically.

  • Use the disabled prop to apply the HTML disabled attribute to the radio button <input>. This prevents merchants from being able to interact with the radio button, and conveys its inactive state to assistive technologies.
  • Use the id prop to provide a unique id attribute value for the radio button. If an id isn’t provided, then the component generates one. All radio buttons must have unique id values to work correctly with assistive technologies.

Labeling

  • The required label prop conveys the purpose of the radio button to all merchants
  • Use the labelHidden prop to visually hide the label but make it available to assistive technologies
  • When you provide help text via the helpText prop or an inline error message via the error prop, the help or error content is conveyed to screen reader users with the aria-describedby attribute

Keyboard support

  • Move focus to the radio button group using the tab key (or shift + tab when tabbing backwards)
  • Use the up and down arrow keys to change which radio button is selected

Default radio button

Use radio buttons where merchants must make a single selection.

Default radio button on Android

Toggle

Use toggles when merchants need to make a binary choice (on or off).

Android toggle with on or off options

Accessibility

See Material Design and development documentation about accessibility for Android:

Default radio button

Use radio buttons where merchants must make a single selection.

Default radio button on iOS

Toggle

Use toggles when merchants need to make a binary choice (on or off).

iOS toggle with on or off options

Accessibility

See Apple’s Human Interface Guidelines and API documentation about accessibility for iOS:

Best practices

Radio buttons should:

  • Always be used with an associated label component.
  • Be part of a list of radio buttons that:
    • Include at least two or more choices.
    • Are used to have merchants select only one option.
    • Include mutually exclusive options—this means that each option must be independent from every other option in the list. For example: Red, blue, and yellow are mutually exclusive. Red, blue, yellow, red/blue are not mutually exclusive.
    • List options in a rational order that makes logical sense.

Content guidelines

Radio button labels

Radio button labels should:

  • Be introduced with a colon or a heading
  • Start with a capital letter
  • Option 1

  • option 1

  • Not end in punctuation if it’s a single sentence, word, or a fragment
  • Red

  • Red;

Toggle (Android and iOS only)

Toggle labels should:

  • Be clear what merchants are enabling or disabling
  • Start with a capital letter

Toggle values should:

  • Never be labeled