Skip to content

Your web browser is out of date

Your web browser (the software you use to access the internet) is out of date. You need to update it or use a different web browser to ensure you can complete this form.

Cookies disabled

Cookies are currently not enabled in your web browser. You need to enable cookies to ensure you can complete this form.

Alert

The Alert component displays high-priority messages that require user’s attention. It is also known as a “system alert” or “global message”.

Experimental component

This is a first iteration of the Alert component currently implemented in the Allocate application. The component is displayed across the application, but only for those who are classified as ‘Admin users’.

The Design System team are discussing our approach to ‘global messaging’ approach so this component is not ready for general use.

<div class="asp-alert" role="region">
  <div class="asp-container asp-alert__content">
      <p>Last import - 9 September 2025 12:34</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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ content: { text: "Last import - 9 September 2025 12:34" } }) }}

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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ content: { text: "Last import - 9 September 2025 12:34" } }) }}

<div class="asp-alert asp-alert--green" role="region">
  <div class="asp-container asp-alert__content">
      <p>Last import - 9 September 2025 12:34</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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "green", content: { text: "Last import - 9 September 2025 12:34" } }) }}

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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "green", content: { text: "Last import - 9 September 2025 12:34" } }) }}

<div class="asp-alert asp-alert--amber" role="region">
  <div class="asp-container asp-alert__content">
      <p>Last import - 9 September 2025 12:34</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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "amber", content: { text: "Last import - 9 September 2025 12:34" } }) }}

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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "amber", content: { text: "Last import - 9 September 2025 12:34" } }) }}

<div class="asp-alert asp-alert--red" role="region">
  <div class="asp-container asp-alert__content">
      <p><strong>Last import</strong>: 9 September 2025 12:34 - see <a href="#">advisory note</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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "red", content: { html: "<p><strong>Last import</strong>: 9 September 2025 12:34 - see <a href=</span>"#">advisory note</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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "red", content: { html: "<p><strong>Last import</strong>: 9 September 2025 12:34 - see <a href=</span>"#">advisory note</a></p>" } }) }}

<div class="asp-alert asp-alert--grey" role="region">
  <div class="asp-container asp-alert__content">
      <p><strong>Last import</strong>: 9 September 2025 12:34 - see <a href="#">advisory note</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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "grey", content: { html: "<p><strong>Last import</strong>: 9 September 2025 12:34 - see <a href=</span>"#">advisory note</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 'green', 'amber', 'red', 'grey' false (boolean) or null. 'blue', false (boolean) or null will have a blue background.
content array Required. The alert component content. See content.

Options for content

Name Type Description
html string Required. HTML for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
text string Required. Text for the alert component content. If 'html' is provided, the 'text' parameter will be ignored.
{% from "components/alert/macro.njk" import aspAlert %}

{{ aspAlert({ modifier: "grey", content: { html: "<p><strong>Last import</strong>: 9 September 2025 12:34 - see <a href=</span>"#">advisory note</a></p>" } }) }}

<div class="asp-alert asp-alert--red" role="region">  
  <div class="asp-container">  
      <p><strong>Plane crash in Ahmedabad</strong>: The UK is working with local authorities in India to urgently establish the facts and provide support to those involved. <a href="#">What to do if you have concerns about friends or family</a>.</p>  
  </div>  
</div>

When to use this component

Use the Alert component to notify users of critical, system-wide issues that require immediate attention. This includes errors, warnings, or important updates that affect the whole service or system.

When not to use this component

Do not use the Alert component for contextual or page-specific messages. For example:

  • Success messages after form submissions
  • Informational notes within a page
  • Status updates relevant only to a specific section

For these cases, consider using the ‘Notification‘ component instead.

Examples of where we have used this component

  • Allocate – purpose a “system health” warning related to the import of data

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 Failing
HTML / Nunjucks version Completed
Figma version Not started
M365 versions Completed
Documentation In progress

Make a change to the Design System

Suggest an edit to this system, or any of the components in it, by submitting a Design System change request.


Published 3 May 2024
Last updated 11 November 2025