Skip to content

Alert

SAlert is a notification block with a semantic variant, a title and optional dismissal. The status icon is rendered with the reusable SIcon (composition instead of duplicated SVG).

Variants

Information
A regular informational message.
Done
Your changes have been saved.
Warning
Please check the data you entered.

Closable

Tip
This notification can be closed.

Custom icon

The icon prop overrides the icon assigned by the status variant — pass a registry name.

Note
The status icon is replaced with a custom one.

Title and icon slots

The icon and title slots replace the status icon and the title with your own markup (the icon slot takes precedence over the icon prop).

New notification N
The icon and title slots replace the icon and the title with your own markup.

Color

The color prop sets a color from the palette and overrides the variant color.

Indigo
A calm accent from the palette.
Blue-grey
A neutral bluish-gray accent.

API

Props

NameTypeDefaultDescription
colorstringundefinedAccent color: a name from the palette (primary/teal/teal-10). Overrides the variant color.
variant | "info" | "positive" | "negative" | "warning""info"Semantic variant: info/positive/warning/negative.
squarebooleanundefinedSquare corners: removes the border radius (rounded by default).
titlestringundefinedTitle (can be replaced with the title slot).
closablebooleanfalseShows the close button (emits close).
iconstringundefinedIcon (a registry name or a raw SVG path). Overrides the variant's status icon; the icon slot takes precedence.
close-labelstringundefinedAccessible name of the close button (defaults to the locale dictionary).

Events

NameSignatureDescription
close() => voidThe close button was clicked.

Slots

NameDescription
defaultAlert body.
titleTitle (alternative to the title prop).
iconCustom icon (replaces the status icon).