Radio Buttons
When to use this component
Use the radios component when users can only select one option from a list.
When not to use this component
Do not use the radios component if users might need to select more than one option. In this case, you should use the checkboxes component instead.
How it works
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 are asking a question as the heading for the page , 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.
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 realize they’ve missed a question
submit the wrong answer
Users cannot go back to having no option selected once they have selected one, without refreshing their browser window. Therefore, you should include ‘None of the above’ or ‘I do not know’ if they are valid options.
Order radio options alphabetically by default.
In some cases, it can be helpful to order them from most-to-least common options. For example, you could order options for ‘Where do you live?’ based on population size.
However you should do this with extreme caution as it can reinforce bias in your service. If in doubt, order alphabetically.
Radio items with hints
You can add hints to radio items to provide additional information about the options.
Radio items with hints example
This space can be used to describe the radio group in general and give more details about the options below.
Radio items with hints example
This space can be used to describe the radio group in general and give more details about the options below.
Exemple des éléments de bouton radio avec des conseils
Cet espace peut être utilisé pour décrire le groupe radio en général et donner plus de détails sur les options ci-dessous.
Exemple des éléments de bouton radio avec des conseils
Cet espace peut être utilisé pour décrire le groupe radio en général et donner plus de détails sur les options ci-dessous.
Radio items with a text divider
If one or more of your radio options is different from the others, it can help users if you separate them using a text divider. The text is usually the word ‘or’.
Radio items with a text divider example
Radio items with a text divider example
Exemple des éléments de bouton radio avec un séparateur de texte
Exemple des éléments de bouton radio avec un séparateur de texte
Conditionally revealing content
You can conditionally reveal content when the user selects a particular radio, so they only see content when it’s relevant to them.
For example, you could reveal a phone number input when the user selects the ‘Contact me by phone’ option.
Conditionally revealing content example
Select one option.
Conditionally revealing content example
Select one option.
Exemple de contenu révélateur conditionnel
Sélectionnez toutes les options qui vous concernent.
Exemple de contenu révélateur conditionnel
Sélectionnez toutes les options qui vous concernent.
Smaller radios
Use standard-sized radios in nearly all cases. However, smaller versions work well on pages where it’s helpful to make them less visually prominent.
For example, on a page of search results, the primary user need is to see the results. Using smaller radios lets users see and change search filters without distracting them from the main content
Exemple de petites boutons radio
Exemple de petites boutons radio
Error messages
Display an error message if none of the radios are selected.
Have you changed your name?
This includes changing your last name or spelling your name differently.
Error: Select yes or no before you continue
Have you changed your name?
This includes changing your last name or spelling your name differently.
Error: Select yes or no before you continue
Avez-vous changé votre nom?
Cela inclut le changement de votre nom de famille ou l'épellation de votre nom différemment.
Erreur : Sélectionner « Oui » ou « Non » avant de continue.
Avez-vous changé votre nom?
Cela inclut le changement de votre nom de famille ou l'épellation de votre nom différemment.
Erreur : Sélectionner « Oui » ou « Non » avant de continue.