Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES

Alert

Contextual messages with hierarchy, an icon and optional actions.

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add alert

Dependencies

What add alert installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

  • @zuno/utils

Examples

2 examples · 1 component
alert

Semantic intents

Success, warning and error with soft surfaces.

alert

With an icon

An indicator reinforces the message without relying on color.

API reference

Forwards props and ref to the container element; it only adds composition utilities.

PropTypeDefault
variant

Intent and semantic color.

"default" | "success" | "warning" | "info" | "destructive""default"

States

The states that apply to this component and their visual treatment.

StateTreatment
Variantdefault, success, warning, info and destructive with a soft surface.
StaticMessage present on the page; consider removing the role.
Dynamicrole="alert" announces the message when it appears.

Accessibility

Every state is understood through text, not color alone: use AlertTitle and AlertDescription.

role="alert" announces messages that appear dynamically; for static content consider removing the role.