Alert

Feedback

Displays a contextual status message. Use for important feedback that requires user attention.

Preview

Props API

PropTypeDefaultDescription
titlestring"Heads up!"Alert headline
messagestring"This is an informational message with detail."Alert body text
variantselect"info" | "success" | "warning" | "error""info"Semantic color variant
dismissiblebooleanfalseShows a close button to dismiss the alert
showIconbooleantrueDisplays a contextual icon

Usage

Use "info" for neutral updates, "success" for completed actions, "warning" for things needing attention, and "error" for failures. Place alerts near the content they relate to — not always at the top of the page.

Accessibility

  • Uses role="alert" so screen readers announce the content immediately on render.

  • For non-urgent messages, role="status" is more appropriate.

  • The dismiss button includes an aria-label for screen readers.