Alerts


Component Behavior

Used to confirm actions. This example is adapted from W3C's Alert Dialog documentation

Opens an alert component with semi-transparent overlay to display information about an action being taken and options for what to do regarding that action. Can be dismissed by clicking the overlay or the close button in the upper right corner.


Accessibility Guidelines

Key accessibility guidelines include:

  • Keyboard Navigation:
    • Escape key closes the alert
  • Focus Management: Component receives focus when it opens. Acts as a "focus trap" and cannot be tabbed out of while it is active.
  • Screen Reader Compatibility: Use semantic HTML and ARIA roles to ensure that assistive technologies accurately interpret the alert.
    • Alert header has an ID so it can be used as aria-labelledby for the component
    • Alert content has an ID so it can be used as aria-describedby for the component
    • Has role="alertdialog"
    • Has aria-modal="true"


Component Example


Link

Follow this link to the component in the GitHub repository.

Title of Alert

Content in an alert

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lectus velit, feugiat in lacinia eget, tristique ut orci. Phasellus ut egestas tellus. In hac habitasse platea dictumst. Nullam efficitur finibus facilisis. In dui ipsum, congue ut ornare vitae, sollicitudin vitae velit. Proin congue nunc quam, a sagittis purus suscipit sed. Quisque tincidunt congue erat, ac placerat ex dapibus in. Duis velit risus, mattis a volutpat et,