Skip to content

Official government website An official website of the Federal Government of Nigeria

How you know
Federal Ministry of Communications, Innovation & Digital Economy Nigerian Design Standards

Alert

Shows a message about the page or form people are on: a result, a problem or a heads-up. It stays in the page until the situation changes.

Updated

Live example

Alert
Controls
Property Control What it does
Info, success, warning or error
Layout
Compact for one-line messages
Title
Says what happened in a few words
What happened and what to do

Overview

An alert sits in the page next to the content it describes and stays until the situation changes. Four statuses tell people how much the message matters.

Use an alert for

  • A message about this page or form that people must still see
  • Problems after a failed submit, with a list linking to each field
  • A confirmation with a reference number or a next step

Don’t use an alert for

  • Passing feedback like “Saved” or “Copied” (use a toast)
  • A notice for the whole site, like planned downtime (use a banner)
  • Long explanations or legal text (use page content)

Statuses

Pick the status from what the message means, and use the same status for the same meaning across a service.

Information:

Online renewals will be unavailable on Saturday.

Info

Neutral updates and things people should know.

Request sent!

Your reference number:

BC-2026-04817

Success

Something completed. Keep any reference number on the page.

Warning

Needs attention soon, but doesn’t block people.

Error

Something failed or must be fixed. Say what to do.

Specifications

The properties of the nds-alert component. The same in HTML, WordPress and React.

Alert properties
Property Type Possible values Description
status string
  • info default
  • success
  • warning
  • error
What the message means. Sets the strip, background and border colours.
layout string
  • default default
  • compact
Compact has 8px padding, for one-line messages.
title string
  • any text
Optional. Says what happened in a few words. With a list, say how many problems.
message string
  • any text
One or two sentences. Say what to do next.
list array
  • none default
  • problems
Optional. One link per problem, each going to its field.
reference string
  • none default
  • any text
Optional. Shows a reference number large, so people can note it down.
link object
  • none default
  • text + href
Optional. One nds-link for the next step.

In code, an alert added after the page loads uses role="alert" (error, warning) or role="status" (success, info). Start with a visually hidden “Error:”, “Warning:”, “Success:” or “Information:” unless the title says it.

Tokens

Alert tokens and contrast
Part Token Contrast on the page
Strip (6px) status/info · success · warning · error /surface Info 5.6:1 · Success 5.8:1 · Warning 4.9:1 · Error 4.9:1
Background status/… /bg —
Border (top, right, bottom) status/… /border, 1px Decorative
Title, message, list text/primary on status/… /bg 15.9:1 or more
Link nds-link (status/info/surface) 5.0:1 on success
Padding · corners 16px (8px compact) · radius/050 —

Use cases

Do

After a failed submit, say how many problems and link each one to its field.

Don’t

Success:

Your changes have been saved.

Don’t use an alert for passing feedback like “Saved”. Use a toast, which disappears on its own.

Layout

Where an alert goes and how much room it takes.

Above what it describes
At the top of the form or section it relates to, below the heading.
Full column width
Match the width of the content under it, so it lines up with the fields.
One at a time
Show one alert per place. Combine messages instead of stacking several.
16px padding
8px for one-line compact alerts. 4px corners.
Short
One or two sentences, or a short list. Link to longer detail.

Copywriting

How to write alert text. Say what happened and what to do, in plain words.

Say what happened and what to do

“The selected file must be smaller than 5MB.”

Put the status in words

The title or a hidden status word says it. Never rely on the colour.

Count the problems

With a list: “There were 2 problems with your registration”.

Link each problem

Each list item goes to its field, with the same words as the field’s error.

Keep it short

One or two sentences. Link to the full detail.

Same status, same meaning

A saved record is Success everywhere in the service.

Examples

Alert copywriting examples
Write Don’t write Why
The selected file must be smaller than 5MB Upload failed Says what to fix.
There were 2 problems with your registration Errors occurred Says how many.
Request sent! Your reference number: BC-2026-04817 Success! Gives people what they need next.
Your session will end in 5 minutes Warning: timeout Plain words and a time.
Online renewals will be unavailable on Saturday Scheduled maintenance Says what and when.

Accessibility

People have to notice an alert, so the status is in the words, never only in the colour.

Keyboard interaction for alerts
Key What it does
Tab Reaches the link in the alert, in reading order. The alert itself isn’t a Tab stop.
Shift + Tab Moves back.
Enter Follows the link.
  • The status is in the words: the title or a hidden status word (WCAG 1.4.1).
  • Alerts added after the page loads are announced with role="alert" or role="status" (WCAG 4.1.3).
  • After a failed submit, focus moves to the alert so people land on the list of problems.
  • Text on every status background is 15.9:1 or more (WCAG 1.4.3).
  • Every status strip is 3:1 or more against the page (WCAG 1.4.11), and it is never the only cue.

For developers

Copy the code for HTML, WordPress or React from the Code tab in Live example. The options are listed under Specifications.

For designers

Use nds-alert from 01 Library – Foundations. Pick the Status and Layout, then turn on the title, list, reference or link you need. Don’t detach it.

References

Feedback

Report a problem with this page