Alerts
Search the component library

Alerts

v1.0.0-beta.5
Download UI Kit v1.9.0

Presents important feedback or information to users either in response to their actions or upon page load.

Download UI Kit v1.9.0

Usage Guidelines

Simple confirmation acknowledgements that don’t require additional detail should just use a confirmation button. If an error occurs or additional information is needed to clarify then the appropriate alert style may be dynamically presented.

Features

  • Modes for page load and dynamic presentation
  • Animated presentation
  • Error, information, and confirmation styles

Static Presentation

When a message needs to be displayed upon page load (there was an error confirming an email address, for example) the alert should appear statically in the upper left corner of the page. This location makes it noticeable even when the user’s screen is magnified.

The message should appear in the upper corner as part of the normal page load, with no animation.

At responsive sizes the alert occupies the entire top of the viewport.

Responsive alert.

Dynamic Presentation

Alerts can also appear dynamically in response to user actions like submitting a form, choosing an option, or completing an assignment. In this case the alert will animate down from the top.

The animation for showing/dismissing a dynamic alert.

Alert Types

Alerts come in two different types, Error and Success. Try to avoid using the success style unless you need to present more information about the success. Confirmation Buttons are a better pattern for typical cases.

The two alert styles. Note that success alerts should only be used when there is additional information that needs to be conveyed.

Redlines

Dimensions
  • Color bar is 6px high
  • Horizontal and bottom padding is 15px
  • Title is 10px below color bar and 8px above message text
Colors
Icon
  • Generic X
Typography
Animation
  • Drop in uses an ease-in-out easing curve with a duration of 300ms
  • Slide out uses an ease-in easing curve with a duration of 200ms
Position
  • Alert should be aligned with the left side of the grid’s container
  • 50px of spacing above the first alert
  • 20px spacing between alerts if there are more than one
Focus Behavior
  • Most alerts can just be announced by using ARIA alert roles and don’t need special focus treatment
  • If an alert is particularly important, focus should be moved to the first element of the alert (and restored to it’s original position upon dismissal)
  • Statically presented alerts should just be read and focused in the normal flow of the document

Changelog

1.0.0-beta.5

  • CHANGED: Uses basic CSS easing curves, rather than springs.

1.0.0-beta.4

  • FIXED: Accessibility verbiage is now more accurate
  • FIXED: Spacing verbiage, other typos

1.0.0-beta.3

  • ADDED: Positioning details to redlines
  • UPDATED: Keyboard and focus redlines.

1.0.0-beta.2

  • ADDED: Success style, redlines, a11y checklist

1.0.0-beta.1

Initial version