Skip to content
Browse docs and components

Alert

alert

An inline message in four states, with a matching icon, an optional title and room for an action. Only the destructive state interrupts a screen reader; the rest wait their turn.

Responsive

Install

$npxshadcnadd@forme/alert

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Alert

An inline message about the page or a part of it.

PropTypeDefaultDescription
variant'info' | 'success' | 'warning' | 'destructive'"info"
titleReactNode—
iconReactNode—An icon element. Defaults to a glyph that matches the variant.
actionReactNode—Buttons or links, placed on the right on wide screens and below on narrow ones.

Also takes every prop of <div> attributes.