Skip to content

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 Required. The action component content. See content.

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 "components/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 Required. The action component content. See content.

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 "asp-frontend/components/action/macro.njk" import aspAction %}

{{ aspAction({
title: "Action title",
content: {
html: '<p>Action content (html) with a <a href="#">link</a>.</p>' }
}) }}

Name Type Description
HeaderText string or false (boolean) Required. Text input for the text to be displayed in the header.
BodyHTMLText string or false (boolean) Required. HTML text input for the body of the action component.
BlueOrRead string or false (boolean) Required. Text input, use either "Blue" or "Red" to switch between variations. Can be controlled with a variable.
Font string or false (boolean) Required. This is the font that the text will be shwon in. This will likely be Font.'Seqoe UI'.
DarkMode string or false (boolean) Required. Input to determine if the component should be dark mode or not. Set by named formula variable varDarkMode.
TextBoxHeight string or false (boolean) Required. This is an output property which is then used as the component Heigh property for example cmp_ASP_Action.TextBoxHeight.
<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)</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 Required. The action component content. See content.

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 "components/action/macro.njk" import aspAction %}

{{ aspAction({
modifier: "urgent",
title: "Action title",
content: {
text: "Action content (text)"
}
}) }}

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 Required. The action component content. See content.

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 "asp-frontend/components/action/macro.njk" import aspAction %}

{{ aspAction({
modifier: "urgent",
title: "Action title",
content: {
text: "Action content (text)"
}
}) }}

Name Type Description
HeaderText string or false (boolean) Required. Text input for the text to be displayed in the header.
BodyHTMLText string or false (boolean) Required. HTML text input for the body of the action component.
BlueOrRead string or false (boolean) Required. Text input, use either "Blue" or "Red" to switch between variations. Can be controlled with a variable.
Font string or false (boolean) Required. This is the font that the text will be shwon in. This will likely be Font.'Seqoe UI'.
DarkMode string or false (boolean) Required. Input to determine if the component should be dark mode or not. Set by named formula variable varDarkMode.
TextBoxHeight string or false (boolean) Required. This is an output property which is then used as the component Heigh property for example cmp_ASP_Action.TextBoxHeight.

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 Completed
Documentation In progress

Published 3 May 2024
Last updated 19 February 2025