Skip to content

Feedback

Alert

A short, prominent message with an intent color.

stableNo JS requiredhydrateless/alert.css

A short, prominent message with an intent color and optional title. Use role="alert" so assistive technology announces it. CSS-only.

Playground

Live

Props

The framework bindings expose these props (and forward the rest to the root element).

PropTypeDefaultDescription
intent'info' | 'success' | 'warning' | 'danger' | 'neutral''neutral'Color and default icon.
titlestringOptional bold heading above the body.

CSS variables

Override these on any ancestor to theme the component. See the theme studio to preview changes live.

CSS variableUsed for
--hl-infoAccent for the info intent (and the success/warning/danger equivalents).
--hl-radius-mdCorner radius.

Accessibility

  • role="alert" makes screen readers announce the message immediately.
  • A leading <svg> is automatically tinted to match the intent.

Released under the MIT License.