NICE Design System home

Radio

Use the radio component when users can only select one option from a list.

Radio buttons are a common way to allow users to make a single selection from a list of options. Since only one radio button can be selected at a time (within the same group), each available choice must be its own item and label.

When to use

Use the radios component when users can only select one option from a list.

When not to use

If users need to be able to pick more than one option from a list, use the checkboxes component instead.

How to use

Always position radios to the left of their labels. This makes them easier to find, especially for users of screen magnifiers.

Unlike with checkboxes, users can only select one option from a list of radios. Do not assume that users will know how many options they can select based on the visual difference between radios and checkboxes alone.

If needed, add a hint explaining this, for example, 'Select one option'.

Do not pre-select radio options as this makes it more likely that users will:

  • not realise they've missed a question
  • submit the wrong answer

Order radio options alphabetically by default.

Group radios together in a fieldset with a legend that describes them, as shown in the examples on this page. This is usually a question, like 'Where do you live?'

If you're asking one question on the page

If you are asking just one question per page as recommended, you can set the contents of the <legend> as the page heading. This is good practice as it means that users of screen readers will only hear the contents once.

Read more on the gov.uk Design System about why and how to set legends as headings.

Default radios

React
HTML

_10
<>
_10
<Radio label="Yes" value="Yes" name="defaultradioexample" />
_10
<Radio label="No" value="No" name="defaultradioexample" />
_10
</>

Inline radios

In some cases, you can display radios 'inline' beside one another (horizontally).

Only use inline radios when:

  • the question only has two options
  • both options are short

Remember that on small screens such as mobile devices, the radios will still be 'stacked' on top of one another (vertically).

React
HTML

_10
<>
_10
<Radio inline label="Yes" value="Yes" name="inlineradio" />
_10
<Radio inline label="No" value="No" name="inlineradio" />
_10
</>

Radios with hints

You can add hints to radio items to provide additional information about the options.

Some helpful hint text
React
HTML

_10
<>
_10
<Radio
_10
hint="Some helpful hint text"
_10
label="Yes"
_10
value="Yes"
_10
name="hintradio"
_10
/>
_10
<Radio label="No" value="No" name="hintradio" />
_10
</>

Errors

React
HTML

_10
<>
_10
<Radio error={true} label="Yes" value="Yes" name="errorradio" />
_10
<Radio label="No" value="No" name="errorradio" />
_10
</>

Error with message

Error message

React
HTML

_10
<>
_10
<Radio
_10
error="Error message"
_10
label="Yes"
_10
value="Yes"
_10
name="errorhintradio"
_10
/>
_10
<Radio label="No" value="No" name="errorhintradio" />
_10
</>

Disabled radios

Disabled radio inputs can be used to indicate inputs that are no longer valid or expired.

React
HTML

_10
<>
_10
<Radio disabled label="Yes" value="Yes" name="disabledradio" />
_10
<Radio disabled label="No" value="No" name="disabledradio" />
_10
</>

Accessibility

We use a custom style for radio buttons, so they're more prominent and easier to use than the standard radio buttons defined by the user's browser. We also use a custom style to clarify their focused and selected states.

Component meets WCAG AA guidelines for accessibility on:

  • Text contrast - Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 )1.4.3).
  • UI contrast - Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).
  • Accessible use of colour - Colour is not used as the only visual means of conveying information (WCAG 2.0 1.4.1).

Research/evidence

We tested the radio component on a "In consultation Comment Collection" prototype in 2021. Users understood the purpose of the radios and were able to use them.

Help improve this page

To help make sure that this page is useful, relevant and up to date, you can:

Need help?

If you've got a question about the NICE Design System, contact the team.