Alert
Callout banner for important messages, composed with AlertTitle and
AlertDescription.
Lay out as a two-column grid: a direct-child <svg> is auto-detected and
given its own icon column, otherwise the text spans full width. Renders
role="alert" so screen readers announce it; tone="danger" recolours the
text and description for error states.
Usage
Best practices
Use
Alertfor a persistent inline message block; a transient, auto-dismissing notification is a toast (Toasterandtoast()fromcomponents/toast).Compose
AlertTitle/AlertDescriptionas children and render a direct-child<svg>for the auto-detected icon column;tone="danger"recolours for errors.It renders
role="alert", so AT announces it on mount - keep it a notice, not a container for heavy interactive UI.
Props
Also exports
- const
alertAnatomy - component
AlertDescription - component
AlertTitle
Anatomy
Composition
Builds on