Alert

Feedback

A message in the page: <Alert.Root> (variant: default, info, success, warning, error) holds an optional icon first, an Alert.Title and an Alert.Description. The text stays readable on a tint of the status colour; the icon takes the colour. warning and error are role="alert", announced when they appear; the others role="status".

import { Alert } from '@limerdev/zest';
Alert for AI tools (llms.txt)
Use for
A message about the page or a form that stays until the situation changes: a failed save, an overdue payment, a read-only record.
Don't
A passing confirmation ("Saved"): use a toast. A question that needs an answer: use AlertDialog. A field's error: use Field.Error.

Examples

Variants

An icon, a title and a description, in each variant.

This invoice is read only
Reminders go out on Mondays
Payment received

Props

Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that renders your own element, with props to spread on it).

Alert.Root

Prop Type Default Description
variant "error" | "default" | "info" | "success" | "warning" 'default' The kind of message, which sets its colour and its role (alert for warning and error, status for the rest).

Alert.Title

No props of its own beyond the common ones.

Alert.Description

No props of its own beyond the common ones.