Radio buttons
About this component
Radio buttons are a form component that allows users to select a single item from a list of options.
Why we use this component
We use this component when we want users to be able to only pick one option from a list.
If there are lots of options, you should think about whether a select component would work better.
If users need to be able to pick more than one option from a list, use the checkboxes component instead.
Other versions of this component
Radio buttons with hint text
You can add hint text to radio buttons, the same as you can with any other form component.
Small radio buttons
Small radio buttons look smaller but their actual size is the same as normal radio buttons. This keeps them easy for users to select.
Error messages
The error state for radio buttons marks the entire fieldset.
Inline radio buttons
In some cases you can display radio buttons beside one another.
Only use inline radio buttons when:
- the question only has two options
- the text for both options is short
If you are using an inline display for a yes/no choice, make ‘Yes’ the first option.
Inline radio buttons have some limitations. You cannot use ‘hint text’ with inline radio buttons. You cannot use inline radio buttons to reveal more questions or content.
Website analytics
You can track radio buttons through the original page path and a data attribute showing the question type and value selected.
The Design System’s “tracking” script adds this data attribute.
Accessibility
We use a custom style for radio buttons. They are larger and easier to use than the standard radio buttons defined by the browser. We also make their focussed and selected states clearer.
Feedback, help and support
If you need help or support you can e-mail us at designsystem@gov.scot
There is a problem
Thanks for your feedback