Components
Inset text
<div class="govuk-inset-text">
It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.
</div>
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.
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.
Primary options
string |
Required.
If html is set, this is not required. Text to use within the inset text component. If html is provided, the text option will be ignored.
|
string |
Required.
If text is set, this is not required. HTML to use within the inset text component. If html is provided, the text option will be ignored.
|
nunjucks-block |
Not strictly a parameter but Nunjucks code convention. Using a call block enables you to call a macro with all the text inside the tag. This is helpful if you want to pass a lot of content into a macro. To use it, you will need to wrap the entire inset text component in a call block.
|
string |
ID attribute to add to the inset text container.
|
string |
Classes to add to the inset text container.
|
object |
HTML attributes (for example data attributes) to add to the inset text container.
|
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{{ govukInsetText({
text: "It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application."
}) }}
When to use this component
Use the inset text component to differentiate a block of text from the content that surrounds it, for example:
- quotes
- examples
- additional information about the page
When not to use this component
Some users do not notice inset text if it’s used on complex pages or near to other visually prominent elements. For this reason, avoid using inset text as a way of highlighting very important information that users need to see.
If you need to draw attention to very important content, like legal information, use the Warning text component instead.
How it works
Use inset text very sparingly - it’s less effective if it’s overused.
There are 2 ways to use the inset text component. You can use HTML or, if you’re using Nunjucks or the GOV.UK Prototype Kit, you can use the Nunjucks macro.
<div class="govuk-inset-text">
It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application.
</div>
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.
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.
Primary options
string |
Required.
If html is set, this is not required. Text to use within the inset text component. If html is provided, the text option will be ignored.
|
string |
Required.
If text is set, this is not required. HTML to use within the inset text component. If html is provided, the text option will be ignored.
|
nunjucks-block |
Not strictly a parameter but Nunjucks code convention. Using a call block enables you to call a macro with all the text inside the tag. This is helpful if you want to pass a lot of content into a macro. To use it, you will need to wrap the entire inset text component in a call block.
|
string |
ID attribute to add to the inset text container.
|
string |
Classes to add to the inset text container.
|
object |
HTML attributes (for example data attributes) to add to the inset text container.
|
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{{ govukInsetText({
text: "It can take up to 8 weeks to register a lasting power of attorney if there are no mistakes in the application."
}) }}
Help improve this component
To help make sure that this page is useful, relevant and up to date, you can:
Tell us if your service uses this component
Take part in our usage survey (opens in a new tab) to help us improve this component to better meet the needs of the services that use it.