Action
<div class="asp-action">
<div class="asp-action__title-container">
<h2 class="asp-action__title">Action title
<span class="asp-action__arrow" aria-hidden="true"></span>
</h2>
</div>
<div class="asp-action__content">
<p>Action content (html) with a <a href="#">link</a>.</p>
</div>
</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.
Name | Type | Description |
---|---|---|
modifier | string or false (boolean) | Default values are 'urgent', false (boolean) or null. |
title | string | Required. The action component title. |
content | array | content. | Required. The action component content. See
Options for content
Name | Type | Description |
---|---|---|
html | string | Required. HTML for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
text | string | Required. Text for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
{% from "action/macro.njk" import aspAction %}
{{ aspAction({
title: "Action title",
content: {
html: '<p>Action content (html) with a <a href="#">link</a>.</p>'
}
}) }}
Twig 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.
Name | Type | Description |
---|---|---|
modifier | string or false (boolean) | Default values are 'urgent', false (boolean) or null. |
title | string | Required. The action component title. |
content | array | content. | Required. The action component content. See
Options for content
Name | Type | Description |
---|---|---|
html | string | Required. HTML for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
text | string | Required. Text for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
{% from "action/macro.njk" import aspAction %}
{{ aspAction({
title: "Action title",
content: {
html: '<p>Action content (html) with a <a href="#">link</a>.</p>'
}
}) }}
<div class="asp-action asp-action--urgent">
<div class="asp-action__title-container">
<h2 class="asp-action__title">Action title
<span class="asp-action__arrow" aria-hidden="true"></span>
</h2>
</div>
<div class="asp-action__content">
<p>Action content (text). modifier: urgent</p>
</div>
</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.
Name | Type | Description |
---|---|---|
modifier | string or false (boolean) | Default values are 'urgent', false (boolean) or null. |
title | string | Required. The action component title. |
content | array | content. | Required. The action component content. See
Options for content
Name | Type | Description |
---|---|---|
html | string | Required. HTML for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
text | string | Required. Text for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
{% from "action/macro.njk" import aspAction %}
{{ aspAction({
modifier: "urgent",
title: "Action title",
content: {
text: "Action content (text). modifier: urgent"
}
}) }}
Twig 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.
Name | Type | Description |
---|---|---|
modifier | string or false (boolean) | Default values are 'urgent', false (boolean) or null. |
title | string | Required. The action component title. |
content | array | content. | Required. The action component content. See
Options for content
Name | Type | Description |
---|---|---|
html | string | Required. HTML for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
text | string | Required. Text for the action component content. If 'html' is provided, the 'text' parameter will be ignored. |
{% from "action/macro.njk" import aspAction %}
{{ aspAction({
modifier: "urgent",
title: "Action title",
content: {
text: "Action content (text). modifier: urgent"
}
}) }}
When to use this component
‘Actions’ are used to highlight content where an action is needed by a user. There are two options:
- Non-urgent: Content where the action is not urgent for the safety of a user. Eg. Ring 101 or complete an online form
- Urgent: Content where the action is paramount to the safety of the user. Eg. Ring 999 now
Status of development
The below criteria all need to be met for a component to be considered as fully developed for use within the ASP Digital Design System.
Development criteria | Status |
---|---|
WCAG 2.2 compliant | Not started |
WCAG 2.1 compliant | Completed |
HTML / Nunjucks version | Completed |
Figma version | Not started |
M365 versions | Not started |
Documentation | In progress |
Published 3 May 2024
Last updated 11 September 2024