Skip to content

Alert

A callout with an icon, a title and a message, in seven intents, with an optional button to dismiss it.

  • .aparte-alert
On this page
Open

.aparte-alert is a callout: an __icon, a __body holding a __title and a __message, and an optional __dismiss button. Its intent (info, success, warning, danger, neutral, primary, secondary) colours it. The chat’s error card wears this recipe, and so do this site’s notes and warnings.

VariableDefault
--aparte-alert-gapvar(--aparte-space-3)
--aparte-alert-paddingvar(--aparte-space-4) var(--aparte-space-5)
--aparte-alert-radiusvar(--aparte-radius-md)
--aparte-alert-rail-widthvar(--aparte-space-1)
--aparte-alert-icon-sizevar(--aparte-space-8)
--aparte-alert-dismiss-sizevar(--aparte-btn-size-sm)
--aparte-alert-title-font-sizevar(--aparte-font-size-md)
--aparte-alert-message-font-sizevar(--aparte-font-size-sm)
--aparte-alert-intent—

.aparte-alert · .aparte-alert--danger · .aparte-alert--info · .aparte-alert--neutral · .aparte-alert--primary · .aparte-alert--secondary · .aparte-alert--success · .aparte-alert--warning · .aparte-alert__body · .aparte-alert__dismiss · .aparte-alert__icon · .aparte-alert__message · .aparte-alert__title

  • An alert that appears while someone is reading takes role="status" (or role="alert" when it must interrupt); one that is part of the page from the start needs neither.
  • The intent is written in the title or the message, not only coloured.
  • The dismiss button shows a cross: give it an aria-label.
  • Error — a failed turn, drawn as an alert.
  • Badge — a status in a word rather than a sentence.