<fieldsetclass="govuk-fieldset"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
Where do you live?
</h1></legend><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live"name="where-do-you-live"type="radio"value="england"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live">
England
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-2"name="where-do-you-live"type="radio"value="scotland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-2">
Scotland
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-3"name="where-do-you-live"type="radio"value="wales"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-3">
Wales
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-4"name="where-do-you-live"type="radio"value="northern-ireland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-4">
Northern Ireland
</label></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-stacked-radios-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-stacked-radios-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-stacked-radios-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-stacked-radios-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-stacked-radios-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-stacked-radios-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
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
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
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.
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.
There are 2 ways to use the radios component. You can use HTML or, if you are using Nunjucks or the GOV.UK Prototype Kit, you can use the Nunjucks macro.
<fieldsetclass="govuk-fieldset"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
Where do you live?
</h1></legend><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live"name="where-do-you-live"type="radio"value="england"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live">
England
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-2"name="where-do-you-live"type="radio"value="scotland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-2">
Scotland
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-3"name="where-do-you-live"type="radio"value="wales"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-3">
Wales
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-4"name="where-do-you-live"type="radio"value="northern-ireland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-4">
Northern Ireland
</label></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-stacked-radios-second-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-stacked-radios-second-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-stacked-radios-second-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-stacked-radios-second-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-second-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-second-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-stacked-radios-second-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-stacked-radios-second-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-second-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-stacked-radios-second-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
If you’re asking more than one question on the page
If you're asking more than one question on the page, do not set the contents of the <legend> as the page heading. Read more about asking multiple questions on question pages.
<div class="app-example app-example--tabs">
<div class="app-example__toolbar">
<a href="/components/radios/without-heading/index.html" class="app-example__new-window" target="_blank">
Open this
<span class="govuk-visually-hidden">radios without a heading</span>
example in a new tab
</a>
</div>
<iframe title="Radios without a heading example" data-module="app-example-frame" class="app-example__frame app-example__frame--resizable app-example__frame--s" src="/components/radios/without-heading/index.html" frameBorder="0" loading="lazy"></iframe>
</div>
<span id="options-radios-without-a-heading-example"></span>
<ul class="app-tabs" role="tablist">
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radios-without-a-heading-example-html" role="tab" aria-controls="radios-without-a-heading-example-html" data-track="tab-html">HTML</a></li>
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radios-without-a-heading-example-nunjucks" role="tab" aria-controls="radios-without-a-heading-example-nunjucks" data-track="tab-nunjucks">Nunjucks</a></li>
</ul>
<div class="app-tabs__heading js-tabs__heading"><a href="#radios-without-a-heading-example-html" aria-controls="radios-without-a-heading-example-html" data-track="tab-html">HTML</a></div>
<div class="app-tabs__container js-tabs__container" id="radios-without-a-heading-example-html" role="tabpanel">
<div class="app-example__code">
<pre data-module="app-copy" tabindex="0"><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"govuk-form-group"</span>></span>
<fieldsetclass="govuk-fieldset"><legendclass="govuk-fieldset__legend">
Where do you live?
</legend><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live"name="where-do-you-live"type="radio"value="england"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live">
England
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-2"name="where-do-you-live"type="radio"value="scotland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-2">
Scotland
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-3"name="where-do-you-live"type="radio"value="wales"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-3">
Wales
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-4"name="where-do-you-live"type="radio"value="northern-ireland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-4">
Northern Ireland
</label></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-radios-without-a-heading-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-radios-without-a-heading-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-radios-without-a-heading-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-radios-without-a-heading-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-without-a-heading-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-without-a-heading-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-radios-without-a-heading-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-radios-without-a-heading-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-without-a-heading-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-without-a-heading-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
<fieldsetclass="govuk-fieldset"aria-describedby="changed-name-hint"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
Have you changed your name?
</h1></legend><divid="changed-name-hint"class="govuk-hint">
This includes changing your last name or spelling your name differently.
</div><divclass="govuk-radios govuk-radios--inline"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="changed-name"name="changed-name"type="radio"value="yes"><labelclass="govuk-label govuk-radios__label"for="changed-name">
Yes
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="changed-name-2"name="changed-name"type="radio"value="no"><labelclass="govuk-label govuk-radios__label"for="changed-name-2">
No
</label></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-inline-radios-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-inline-radios-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-inline-radios-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-inline-radios-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-inline-radios-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-inline-radios-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
{{ govukRadios({
classes: "govuk-radios--inline",
name: "changed-name",
fieldset: {
legend: {
text: "Have you changed your name?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
hint: {
text: "This includes changing your last name or spelling your name differently."
},
items: [
{
value: "yes",
text: "Yes"
},
{
value: "no",
text: "No"
}
]
}) }}
Radio items with hints
You can add hints to radio items to provide additional information about the options.
<div class="app-example app-example--tabs">
<div class="app-example__toolbar">
<a href="/components/radios/hint/index.html" class="app-example__new-window" target="_blank">
Open this
<span class="govuk-visually-hidden">radio items with hint</span>
example in a new tab
</a>
</div>
<iframe title="Radio items with hint example" data-module="app-example-frame" class="app-example__frame app-example__frame--resizable app-example__frame--s" src="/components/radios/hint/index.html" frameBorder="0" loading="lazy"></iframe>
</div>
<span id="options-radio-items-with-hint-example"></span>
<ul class="app-tabs" role="tablist">
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radio-items-with-hint-example-html" role="tab" aria-controls="radio-items-with-hint-example-html" data-track="tab-html">HTML</a></li>
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radio-items-with-hint-example-nunjucks" role="tab" aria-controls="radio-items-with-hint-example-nunjucks" data-track="tab-nunjucks">Nunjucks</a></li>
</ul>
<div class="app-tabs__heading js-tabs__heading"><a href="#radio-items-with-hint-example-html" aria-controls="radio-items-with-hint-example-html" data-track="tab-html">HTML</a></div>
<div class="app-tabs__container js-tabs__container" id="radio-items-with-hint-example-html" role="tabpanel">
<div class="app-example__code">
<pre data-module="app-copy" tabindex="0"><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"govuk-form-group"</span>></span>
<fieldsetclass="govuk-fieldset"aria-describedby="sign-in-hint"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
How do you want to sign in?
</h1></legend><divid="sign-in-hint"class="govuk-hint">
You’ll need an account to prove your identity and complete your Self Assessment.
</div><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="sign-in"name="sign-in"type="radio"value="government-gateway"aria-describedby="sign-in-item-hint"><labelclass="govuk-label govuk-radios__label"for="sign-in">
Sign in with Government Gateway
</label><divid="sign-in-item-hint"class="govuk-hint govuk-radios__hint">
You’ll have a user ID if you’ve registered for Self Assessment or filed a tax return online before.
</div></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="sign-in-2"name="sign-in"type="radio"value="govuk-verify"aria-describedby="sign-in-2-item-hint"><labelclass="govuk-label govuk-radios__label"for="sign-in-2">
Sign in with GOV.UK Verify
</label><divid="sign-in-2-item-hint"class="govuk-hint govuk-radios__hint">
You’ll have an account if you’ve already proved your identity with either Barclays, CitizenSafe, Digidentity, Experian, Post Office, Royal Mail or SecureIdentity.
</div></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-radio-items-with-hint-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-radio-items-with-hint-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-radio-items-with-hint-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-radio-items-with-hint-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radio-items-with-hint-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radio-items-with-hint-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-radio-items-with-hint-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-radio-items-with-hint-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radio-items-with-hint-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radio-items-with-hint-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
{{ govukRadios({
name: "sign-in",
fieldset: {
legend: {
text: "How do you want to sign in?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
hint: {
text: "You’ll need an account to prove your identity and complete your Self Assessment."
},
items: [
{
value: "government-gateway",
text: "Sign in with Government Gateway",
hint: {
text: "You’ll have a user ID if you’ve registered for Self Assessment or filed a tax return online before."
}
},
{
value: "govuk-verify",
text: "Sign in with GOV.UK Verify",
hint: {
text: "You’ll have an account if you’ve already proved your identity with either Barclays, CitizenSafe, Digidentity, Experian, Post Office, Royal Mail or SecureIdentity."
}
}
]
}) }}
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’.
<div class="app-example app-example--tabs">
<div class="app-example__toolbar">
<a href="/components/radios/divider/index.html" class="app-example__new-window" target="_blank">
Open this
<span class="govuk-visually-hidden">radios with a text divider</span>
example in a new tab
</a>
</div>
<iframe title="Radios with a text divider example" data-module="app-example-frame" class="app-example__frame app-example__frame--resizable app-example__frame--s" src="/components/radios/divider/index.html" frameBorder="0" loading="lazy"></iframe>
</div>
<span id="options-radios-with-a-text-divider-example"></span>
<ul class="app-tabs" role="tablist">
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radios-with-a-text-divider-example-html" role="tab" aria-controls="radios-with-a-text-divider-example-html" data-track="tab-html">HTML</a></li>
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radios-with-a-text-divider-example-nunjucks" role="tab" aria-controls="radios-with-a-text-divider-example-nunjucks" data-track="tab-nunjucks">Nunjucks</a></li>
</ul>
<div class="app-tabs__heading js-tabs__heading"><a href="#radios-with-a-text-divider-example-html" aria-controls="radios-with-a-text-divider-example-html" data-track="tab-html">HTML</a></div>
<div class="app-tabs__container js-tabs__container" id="radios-with-a-text-divider-example-html" role="tabpanel">
<div class="app-example__code">
<pre data-module="app-copy" tabindex="0"><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"govuk-form-group"</span>></span>
<fieldsetclass="govuk-fieldset"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
Where do you live?
</h1></legend><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live"name="where-do-you-live"type="radio"value="england"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live">
England
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-2"name="where-do-you-live"type="radio"value="scotland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-2">
Scotland
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-3"name="where-do-you-live"type="radio"value="wales"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-3">
Wales
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-4"name="where-do-you-live"type="radio"value="northern-ireland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-4">
Northern Ireland
</label></div><divclass="govuk-radios__divider">or</div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-6"name="where-do-you-live"type="radio"value="abroad"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-6">
I am a British citizen living abroad
</label></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-radios-with-a-text-divider-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-radios-with-a-text-divider-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-radios-with-a-text-divider-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-radios-with-a-text-divider-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-a-text-divider-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-a-text-divider-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-radios-with-a-text-divider-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-radios-with-a-text-divider-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-a-text-divider-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-a-text-divider-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
{{ govukRadios({
name: "where-do-you-live",
fieldset: {
legend: {
text: "Where do you live?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
items: [
{
value: "england",
text: "England"
},
{
value: "scotland",
text: "Scotland"
},
{
value: "wales",
text: "Wales"
},
{
value: "northern-ireland",
text: "Northern Ireland"
},
{
divider: "or"
},
{
value: "abroad",
text: "I am a British citizen living abroad"
}
]
}) }}
Conditionally revealing a related question
You can ask the user a related question when they select a particular radio option, so they only see the question when it's relevant to them.
This might make two related questions easier to answer by grouping them on the same page. For example, you could reveal a phone number input when the user selects the 'Contact me by phone' option.
<fieldsetclass="govuk-fieldset"aria-describedby="contact-hint"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
How would you prefer to be contacted?
</h1></legend><divid="contact-hint"class="govuk-hint">
Select one option.
</div><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="contact"name="contact"type="radio"value="email"data-aria-controls="conditional-contact"><labelclass="govuk-label govuk-radios__label"for="contact">
Email
</label></div><divclass="govuk-radios__conditional govuk-radios__conditional--hidden"id="conditional-contact"><divclass="govuk-form-group"><labelclass="govuk-label"for="contact-by-email">
Email address
</label><inputclass="govuk-input govuk-!-width-one-third"id="contact-by-email"name="contact-by-email"type="email"spellcheck="false"autocomplete="email"></div></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="contact-2"name="contact"type="radio"value="phone"data-aria-controls="conditional-contact-2"><labelclass="govuk-label govuk-radios__label"for="contact-2">
Phone
</label></div><divclass="govuk-radios__conditional govuk-radios__conditional--hidden"id="conditional-contact-2"><divclass="govuk-form-group"><labelclass="govuk-label"for="contact-by-phone">
Phone number
</label><inputclass="govuk-input govuk-!-width-one-third"id="contact-by-phone"name="contact-by-phone"type="tel"autocomplete="tel"></div></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="contact-3"name="contact"type="radio"value="text"data-aria-controls="conditional-contact-3"><labelclass="govuk-label govuk-radios__label"for="contact-3">
Text message
</label></div><divclass="govuk-radios__conditional govuk-radios__conditional--hidden"id="conditional-contact-3"><divclass="govuk-form-group"><labelclass="govuk-label"for="contact-by-text">
Mobile phone number
</label><inputclass="govuk-input govuk-!-width-one-third"id="contact-by-text"name="contact-by-text"type="tel"autocomplete="tel"></div></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-radios-with-conditionally-revealing-content-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-radios-with-conditionally-revealing-content-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-radios-with-conditionally-revealing-content-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-radios-with-conditionally-revealing-content-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-radios-with-conditionally-revealing-content-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
However, we found that screen reader users did not have difficulty answering a conditionally revealed question - as long it’s kept simple. Users we tested with did get confused when complicated questions were conditionally revealed to them, particularly questions with more than one part.
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.
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-small-radios-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-small-radios-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-small-radios-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-small-radios-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-small-radios-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-small-radios-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-small-radios-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-small-radios-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-small-radios-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-small-radios-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
<fieldsetclass="govuk-fieldset"aria-describedby="where-do-you-live-error"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
Where do you live?
</h1></legend><pid="where-do-you-live-error"class="govuk-error-message"><spanclass="govuk-visually-hidden">Error:</span> Select the country where you live
</p><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live"name="where-do-you-live"type="radio"value="england"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live">
England
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-2"name="where-do-you-live"type="radio"value="scotland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-2">
Scotland
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-3"name="where-do-you-live"type="radio"value="wales"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-3">
Wales
</label></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="where-do-you-live-4"name="where-do-you-live"type="radio"value="northern-ireland"><labelclass="govuk-label govuk-radios__label"for="where-do-you-live-4">
Northern Ireland
</label></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-inline-radios-with-error-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-inline-radios-with-error-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-inline-radios-with-error-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-inline-radios-with-error-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-with-error-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-with-error-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-inline-radios-with-error-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-inline-radios-with-error-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-with-error-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-inline-radios-with-error-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>
{{ govukRadios({
name: "where-do-you-live",
fieldset: {
legend: {
text: "Where do you live?",
isPageHeading: true,
classes: "govuk-fieldset__legend--l"
}
},
items: [
{
value: "england",
text: "England"
},
{
value: "scotland",
text: "Scotland"
},
{
value: "wales",
text: "Wales"
},
{
value: "northern-ireland",
text: "Northern Ireland"
}
],
errorMessage: {
text: "Select the country where you live"
}
}) }}
Make sure errors follow the guidance in error message and have specific error messages for specific error states.
If it’s a ‘yes’ or ‘no’ question
Say ‘Select yes if [whatever it is is true]’. For example, ‘Select yes if Sarah normally lives with you’.
If there are two options which are not ‘yes’ and ‘no’
Say ‘Select if [whatever it is]’. For example, ‘Select if you are employed or self-employed’.
If there are more than two options
Say ‘Select [whatever it is]’. For example, ‘Select the day of the week you pay your rent’.
If it's a conditionally revealed question
Include an error message that is clearly related to the initial question.
<div class="app-example app-example--tabs">
<div class="app-example__toolbar">
<a href="/components/radios/conditional-reveal-error/index.html" class="app-example__new-window" target="_blank">
Open this
<span class="govuk-visually-hidden">radios with conditionally revealing content showing an error</span>
example in a new tab
</a>
</div>
<iframe title="Radios with conditionally revealing content showing an error example" data-module="app-example-frame" class="app-example__frame app-example__frame--resizable app-example__frame--s" src="/components/radios/conditional-reveal-error/index.html" frameBorder="0" loading="lazy"></iframe>
</div>
<span id="options-radios-with-conditionally-revealing-content-showing-an-error-example"></span>
<ul class="app-tabs" role="tablist">
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radios-with-conditionally-revealing-content-showing-an-error-example-html" role="tab" aria-controls="radios-with-conditionally-revealing-content-showing-an-error-example-html" data-track="tab-html">HTML</a></li>
<li class="app-tabs__item js-tabs__item" role="presentation"><a href="#radios-with-conditionally-revealing-content-showing-an-error-example-nunjucks" role="tab" aria-controls="radios-with-conditionally-revealing-content-showing-an-error-example-nunjucks" data-track="tab-nunjucks">Nunjucks</a></li>
</ul>
<div class="app-tabs__heading js-tabs__heading"><a href="#radios-with-conditionally-revealing-content-showing-an-error-example-html" aria-controls="radios-with-conditionally-revealing-content-showing-an-error-example-html" data-track="tab-html">HTML</a></div>
<div class="app-tabs__container js-tabs__container" id="radios-with-conditionally-revealing-content-showing-an-error-example-html" role="tabpanel">
<div class="app-example__code">
<pre data-module="app-copy" tabindex="0"><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"govuk-form-group"</span>></span>
<fieldsetclass="govuk-fieldset"aria-describedby="contact-hint"><legendclass="govuk-fieldset__legend govuk-fieldset__legend--l"><h1class="govuk-fieldset__heading">
How would you prefer to be contacted?
</h1></legend><divid="contact-hint"class="govuk-hint">
Select one option.
</div><divclass="govuk-radios"data-module="govuk-radios"><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="contact"name="contact"type="radio"value="email"checkeddata-aria-controls="conditional-contact"><labelclass="govuk-label govuk-radios__label"for="contact">
Email
</label></div><divclass="govuk-radios__conditional"id="conditional-contact"><divclass="govuk-form-group govuk-form-group--error"><labelclass="govuk-label"for="contact-by-email">
Email address
</label><pid="contact-by-email-error"class="govuk-error-message"><spanclass="govuk-visually-hidden">Error:</span> Email address cannot be blank
</p><inputclass="govuk-input govuk-!-width-one-half govuk-input--error"id="contact-by-email"name="contact-by-email"type="email"spellcheck="false"aria-describedby="contact-by-email-error"autocomplete="email"></div></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="contact-2"name="contact"type="radio"value="phone"data-aria-controls="conditional-contact-2"><labelclass="govuk-label govuk-radios__label"for="contact-2">
Phone
</label></div><divclass="govuk-radios__conditional govuk-radios__conditional--hidden"id="conditional-contact-2"><divclass="govuk-form-group"><labelclass="govuk-label"for="contact-by-phone">
Phone number
</label><inputclass="govuk-input govuk-!-width-one-third"id="contact-by-phone"name="contact-by-phone"type="tel"autocomplete="tel"></div></div><divclass="govuk-radios__item"><inputclass="govuk-radios__input"id="contact-3"name="contact"type="radio"value="text"data-aria-controls="conditional-contact-3"><labelclass="govuk-label govuk-radios__label"for="contact-3">
Text message
</label></div><divclass="govuk-radios__conditional govuk-radios__conditional--hidden"id="conditional-contact-3"><divclass="govuk-form-group"><labelclass="govuk-label"for="contact-by-text">
Mobile phone number
</label><inputclass="govuk-input govuk-!-width-one-third"id="contact-by-text"name="contact-by-text"type="tel"autocomplete="tel"></div></div></div></fieldset></div>
<p>
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
</p>
<p>
Some options are required for the macro to work; these are marked as "Required" in the option description.
</p>
<p>
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against <a href="https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting">cross-site scripting exploits</a>.
</p>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-showing-an-error-example--primary">
<caption class="govuk-table__caption govuk-heading-m govuk-visually-hidden">Primary options</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">fieldset</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the fieldset component (for example legend).
See <a href="/components/fieldset/#options-fieldset-example">fieldset</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the hint component (for example text).
See <a href="#options-radios-with-conditionally-revealing-content-showing-an-error-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">errorMessage</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the error message component. The error message component will not display if you use a falsy value for <code>errorMessage</code>, for example <code>false</code> or <code>null</code>.
See <a href="/components/error-message/#options-error-message-example">errorMessage</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">formGroup</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Options for the form-group wrapper.
See <a href="#options-radios-with-conditionally-revealing-content-showing-an-error-example--formGroup">formGroup</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">idPrefix</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
String to prefix ID for each radio item if no ID is specified on each item. If <code>idPrefix</code> is not passed, fallback to using the <code>name</code> attribute instead.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">name</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Name attribute for each radio item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">items</th>
<td class="govuk-table__cell ">array</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Array of radio items objects.
See <a href="#options-radios-with-conditionally-revealing-content-showing-an-error-example--items">items</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value for the radio which should be checked when the page loads. Use this as an alternative to setting the <code>checked</code> option on each individual item.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the radio container.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-showing-an-error-example--formGroup">
<caption class="govuk-table__caption govuk-heading-m ">Options for formGroup</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the form group (for example to show error state for the whole group).
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-showing-an-error-example--items">
<caption class="govuk-table__caption govuk-heading-m ">Options for items</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within each radio item label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Specific ID attribute for the radio item. If omitted, then <code>idPrefix</code> string will be applied.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">value</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
Value for the radio input.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">label</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide attributes and classes to each radio item label.
See <a href="#options-radios-with-conditionally-revealing-content-showing-an-error-example--label">label</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">hint</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
Provide hint to each radio item.
See <a href="#options-radios-with-conditionally-revealing-content-showing-an-error-example--hint">hint</a>.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">divider</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Divider text to separate radio items, for example the text 'or'.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">checked</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the radio should be checked when the page loads. Takes precedence over the top-level <code>value</code> option.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
If <code>true</code>, content provided will be revealed when the item is checked.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">conditional.html</th>
<td class="govuk-table__cell ">html</td>
<td class="govuk-table__cell ">
Provide content for the conditional reveal.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">disabled</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
If <code>true</code>, radio will be disabled.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the radio input tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-showing-an-error-example--hint">
<caption class="govuk-table__caption govuk-heading-m ">Options for hint</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the hint. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">id</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Optional ID attribute to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the hint span tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the hint span tag.
</td>
</tr>
</tbody>
</table>
<table class="govuk-table app-options__table" id="options-radios-with-conditionally-revealing-content-showing-an-error-example--label">
<caption class="govuk-table__caption govuk-heading-m ">Options for label</caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Name</th>
<th class="govuk-table__header app-options__limit-table-cell" scope="col">Type</th>
<th class="govuk-table__header" scope="col">Description</th>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">text</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>html</code> is set, this is not required. Text to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">html</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
<strong>Required.</strong>
If <code>text</code> is set, this is not required. HTML to use within the label. If <code>html</code> is provided, the <code>text</code> option will be ignored.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">for</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
The value of the <code>for</code> attribute, the ID of the input the label is associated with.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">isPageHeading</th>
<td class="govuk-table__cell ">boolean</td>
<td class="govuk-table__cell ">
Whether the label also acts as the heading for the page.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">classes</th>
<td class="govuk-table__cell ">string</td>
<td class="govuk-table__cell ">
Classes to add to the label tag.
</td>
</tr>
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="row">attributes</th>
<td class="govuk-table__cell ">object</td>
<td class="govuk-table__cell ">
HTML attributes (for example data attributes) to add to the label tag.
</td>
</tr>
</tbody>
</table>