- A-Z
- Accordion
- Acronym
- Action
- Alert
- Breadcrumbs
- Button
- Card
- Checkboxes
- Confirmation
- Cookie banner
- Copy
- Date input
- Details
- Environment
- Error summary
- Filter
- Footer
- Forms
- Group
- Header
- Help
- Hero
- Horizontal rule
- Input
- Leave site
- Notification
- Pagination
- Panel
- Progress
- Radios
- Search input
- Select
- Signage
- Skip link
- Status
- Steps
- Summary list
- Table
- Tabs
- Textarea
- Time input
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.
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" aria-label="Planned maintenance">
<div class="asp-container asp-alert__content">
<span class="asp-alert__icon asp-alert__icon--with-title" aria-hidden="true"></span>
<h2 class="asp-alert__title">Planned maintenance</h2> The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S).
</div>
</div>
{
"type": "alert",
"params": {
"title": "Planned maintenance",
"content": {
"html": "The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S)."
}
}
}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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({
title: "Planned maintenance",
content: {
html: "The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S)."
}
}) }}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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 "@asp-frontend/components/alert/macro.twig" import aspAlert %}
{{ aspAlert({
title: "Planned maintenance",
content: {
html: "The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S)."
}
}) }}
<div class="asp-alert asp-alert--red" role="region" aria-label="(NAME OF SERVICE) unavailable">
<div class="asp-container asp-alert__content">
<span class="asp-alert__icon asp-alert__icon--with-title asp-alert__icon--red" aria-hidden="true"></span>
<h2 class="asp-alert__title">(NAME OF SERVICE) unavailable</h2> The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S).
</div>
</div>
{
"type": "alert",
"params": {
"modifier": "red",
"title": "(NAME OF SERVICE) unavailable",
"content": {
"html": "The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S)."
}
}
}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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",
title: "(NAME OF SERVICE) unavailable",
content: {
html: "The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S)."
}
}) }}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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 "@asp-frontend/components/alert/macro.twig" import aspAlert %}
{{ aspAlert({
modifier: "red",
title: "(NAME OF SERVICE) unavailable",
content: {
html: "The (NAME OF SERVICE) system will be unavailable due to planned maintenance from (DATE/TIME) to (DATE/TIME). <br> During this time, you can contact us by (INSERT CONTACT METHOD/S)."
}
}) }}
<div class="asp-alert" role="region">
<div class="asp-container asp-alert__content">
<span class="asp-alert__icon" aria-hidden="true"></span>
<p>Alert content</p>
</div>
</div>
{
"type": "alert",
"params": {
"content": {
"text": "Alert content"
}
}
}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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: "Alert content"
}
}) }}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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 "@asp-frontend/components/alert/macro.twig" import aspAlert %}
{{ aspAlert({
content: {
text: "Alert content"
}
}) }}
<div class="asp-alert asp-alert--red" role="region">
<div class="asp-container asp-alert__content">
<span class="asp-alert__icon asp-alert__icon--red" aria-hidden="true"></span>
<strong>Last update</strong>: <span class="sr-only"> failed </span> 9 September 2026 12:34
</div>
</div>
{
"type": "alert",
"params": {
"modifier": "red",
"content": {
"html": "<strong>Last update</strong>: <span class=\"sr-only\"> failed </span> 9 September 2026 12:34"
}
}
}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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: "<strong>Last update</strong>: <span class="sr-only"> failed </span> 9 September 2026 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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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 "@asp-frontend/components/alert/macro.twig" import aspAlert %}
{{ aspAlert({
modifier: "red",
content: {
html: "<strong>Last update</strong>: <span class="sr-only"> failed </span> 9 September 2026 12:34"
}
}) }}
<div class="asp-alert asp-alert--amber" role="region">
<div class="asp-container asp-alert__content">
<span class="asp-alert__icon asp-alert__icon--amber" aria-hidden="true"></span>
<p>Alert content</p>
</div>
</div>
{
"type": "alert",
"params": {
"modifier": "amber",
"content": {
"text": "Alert content"
}
}
}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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: "Alert content"
}
}) }}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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 "@asp-frontend/components/alert/macro.twig" import aspAlert %}
{{ aspAlert({
modifier: "amber",
content: {
text: "Alert content"
}
}) }}
<div class="asp-alert asp-alert--green" role="region">
<div class="asp-container asp-alert__content">
<span class="asp-alert__icon asp-alert__icon--green" aria-hidden="true"></span>
<strong>Last update</strong>: <span class="sr-only"> successful </span> 9 September 2026 12:34
</div>
</div>
{
"type": "alert",
"params": {
"modifier": "green",
"content": {
"html": "<strong>Last update</strong>: <span class=\"sr-only\"> successful </span> 9 September 2026 12:34"
}
}
}
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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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: {
html: "<strong>Last update</strong>: <span class="sr-only"> successful </span> 9 September 2026 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' false (boolean) or null. 'blue', false (boolean) or null will have a blue background. |
| title | string or false (boolean) | Title for the alert component content. |
| content | object | 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 "@asp-frontend/components/alert/macro.twig" import aspAlert %}
{{ aspAlert({
modifier: "green",
content: {
html: "<strong>Last update</strong>: <span class="sr-only"> successful </span> 9 September 2026 12:34"
}
}) }}
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 | Completed |
| 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 19 October 2026