Form elements
–
Hint text
Use hint text to help users understand a question.
Nunjucks macro options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
Some options are required for the macro to work. These are marked as "Required" in the option description. Deprecated options are marked as "Deprecated".
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.
| Name | Type | Description |
|---|---|---|
| text | string |
Required.
If html is set, this is not required. Text to use within the hint. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the hint. If html is provided, the text argument will be ignored.
|
| id | string |
The id attribute to add to the hint.
|
| classes | string | Classes to add to the hint. |
| attributes | object | HTML attributes (for example data attributes) to add to the hint. |
How to use hint text
Use hint text to show information that helps the majority of users answer the question. Use it to give users help in context.
Keep each hint to a single short phrase or sentence, without full stops.
If you need to give a long, detailed explanation, do not use hint text. Screen readers will read out the entire text when users interact with the form element. This could frustrate users if the text is long.
Do not use links in hint text. While screen readers will read out the link text, they usually do not tell users the text is a link.
Do not use other interactive elements such as the details component in hint text. When screen reader users are in "form mode", they are unable to interact with the link in the component.
Text input with hint text
Nunjucks macro options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
Some options are required for the macro to work. These are marked as "Required" in the option description. Deprecated options are marked as "Deprecated".
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.
| Name | Type | Description |
|---|---|---|
| text | string |
Required.
If html is set, this is not required. Text to use within the hint. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the hint. If html is provided, the text argument will be ignored.
|
| id | string |
The id attribute to add to the hint.
|
| classes | string | Classes to add to the hint. |
| attributes | object | HTML attributes (for example data attributes) to add to the hint. |
Radios with hint text
Nunjucks macro options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
Some options are required for the macro to work. These are marked as "Required" in the option description. Deprecated options are marked as "Deprecated".
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.
| Name | Type | Description |
|---|---|---|
| text | string |
Required.
If html is set, this is not required. Text to use within the hint. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the hint. If html is provided, the text argument will be ignored.
|
| id | string |
The id attribute to add to the hint.
|
| classes | string | Classes to add to the hint. |
| attributes | object | HTML attributes (for example data attributes) to add to the hint. |
Radio items with hints
You can add hints to radios to give more information about the options.
Nunjucks macro options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
Some options are required for the macro to work. These are marked as "Required" in the option description. Deprecated options are marked as "Deprecated".
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.
| Name | Type | Description |
|---|---|---|
| text | string |
Required.
If html is set, this is not required. Text to use within the hint. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the hint. If html is provided, the text argument will be ignored.
|
| id | string |
The id attribute to add to the hint.
|
| classes | string | Classes to add to the hint. |
| attributes | object | HTML attributes (for example data attributes) to add to the hint. |
Checkboxes with hint text
Unlike with radios, users can select more than 1 option from a list of checkboxes. Do not assume that users will know how many options they can select.
Nunjucks macro options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
Some options are required for the macro to work. These are marked as "Required" in the option description. Deprecated options are marked as "Deprecated".
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.
| Name | Type | Description |
|---|---|---|
| text | string |
Required.
If html is set, this is not required. Text to use within the hint. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the hint. If html is provided, the text argument will be ignored.
|
| id | string |
The id attribute to add to the hint.
|
| classes | string | Classes to add to the hint. |
| attributes | object | HTML attributes (for example data attributes) to add to the hint. |
Textarea with hint text
Nunjucks macro options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
Some options are required for the macro to work. These are marked as "Required" in the option description. Deprecated options are marked as "Deprecated".
If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.
| Name | Type | Description |
|---|---|---|
| text | string |
Required.
If html is set, this is not required. Text to use within the hint. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the hint. If html is provided, the text argument will be ignored.
|
| id | string |
The id attribute to add to the hint.
|
| classes | string | Classes to add to the hint. |
| attributes | object | HTML attributes (for example data attributes) to add to the hint. |
Help us improve this guidance
Share insights or feedback and take part in the discussion. We use GitHub as a collaboration space. All the information on it is open to the public.
Feed back or share insights on GitHubRead more about how to feed back or share insights.
If you have any questions, get in touch with the service manual team.
Updated: November 2025