Skip to content

Search

Start typing to search.


Show all pages

Documentation

feedback

Alert

A message about the page or the task at hand, such as a warning or a confirmation.

CSS onlyPlain classes; no JavaScript in any stack.

Usage

An alert needs the component class and one variant. A title alone is enough for a short message.

Your trial ends on 30 November

Add a payment method to keep your projects after that date.

HTML

Examples

Variants

Pick the variant by meaning. The title says what happened, so the message does not rely on color.

Changes are saved as you type

Maintenance on Sunday from 02:00 to 04:00

Invoice sent to the customer

Two lessons have no instructor yet

Payment failed: the card was declined

HTML

With actions

Put buttons in ca-alert__actions, the main action first. This one interrupts, so it uses role="alert".

HTML

Guidance and accessibility

When to use

  • Use an alert for a message about the page or the current task. For the status of one item, such as an invoice, use a badge.
  • Write the title as the message itself: “Payment failed: the card was declined”, not “Error”.
  • Say what to do next in the description or with an action.

Accessibility

  • An alert that appears while people work needs a live region: role="status" for routine news, role="alert" only when it interrupts, such as a session that is about to end. An alert that is in the page when it loads needs neither.
  • The live region must be in the page before its text changes. Add the text to an existing element instead of inserting the whole alert.
  • The title carries the meaning; the color only supports it.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the alert component
ClassKindUse it for
ca-alertComponentBox for the message, with the tone's fill and edge.
ca-alert__titlePartThe message in one line.
ca-alert__descriptionPartMore detail, such as what to do next.
ca-alert__actionsPartRow of buttons that wraps on narrow screens.
ca-alert--neutralVariantGeneral information without urgency.
ca-alert--infoVariantSomething people should know, such as planned maintenance.
ca-alert--successVariantA task finished.
ca-alert--warningVariantSomething needs attention soon.
ca-alert--dangerVariantSomething failed or needs action now.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

Your trial ends on 30 November

Add a payment method to keep your projects after that date.

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

Your trial ends on 30 November

Add a payment method to keep your projects after that date.

Proof skin

Pilot skin pushed far from base: square, heavy, offset shadows, larger targets.

Your trial ends on 30 November

Add a payment method to keep your projects after that date.

Crossview skin

The CrossView proofing table: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

Your trial ends on 30 November

Add a payment method to keep your projects after that date.

Framework notes

Link the prebuilt stylesheet of your skin next to your brand theme. No build step.

HTML
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="ca-base.css" />