Search...

Search documentation...

Alert

Alert

A role="alert" callout box — an icon, a title, a description.

import { Alert, AlertTitle, AlertDescription } from "@pompeitech/vesuvius-ui";

Default

Variants

All variants

Beyond default/destructive/success/warning, info and highlight cover the two remaining semantic tones:

Soft appearance

appearance="soft" swaps the outlined variant color for a tinted background — a dashboard-style callout instead of a warning banner. Every variant above supports it.

No icon

The icon isn't required — AlertTitle/AlertDescription shift left to fill the space when there's no <svg> child (the layout is driven by a has-[>svg] selector, not a prop):

API

Alert

PropTypeDefaultDescription
variant"default" | "destructive" | "success" | "warning" | "info" | "highlight""default"Semantic tone — colors the icon and AlertTitle.
appearance"outline" | "soft""outline""outline": a bordered card on bg-card. "soft": no border, a tinted background matching the variant.

Plus every native <div> prop (role="alert" is already set).

AlertTitle / AlertDescription — every native <div> prop; no custom props of their own beyond styling hooks.

Accessibility

The root carries role="alert", so screen readers announce it as soon as it mounts (an ARIA live region, assertive priority) — reserve it for messages the user genuinely needs interrupted for. For a message that doesn't need to interrupt (a static inline note, not a live status change), consider a plain styled <div> instead and reach for Alert specifically when the content appears dynamically in response to something the user just did.