For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/components/alert.md.

Alert

An inline message bound to one part of the screen, which stays until the state changes or the reader dismisses it — reach for Banner when the message would still matter on another page, Toast for a transient confirmation, and the field’s own error for a single invalid input. color carries the meaning and AlertIcon takes its icon from it, so the pair is not yours to mix; primary is the neutral default for a notice with no status to encode.

Source · Storybook

Usage

import { Alert, AlertContent, AlertDescription, AlertIcon, AlertTitle } from '@wallarm-org/design-system/Alert';

Examples

Title only

A title on its own is a complete alert. Add a description only when it says something the title does not.

With close button

AlertClose gives the reader a way out — add it where dismissing is reasonable, and leave it off while the condition still holds.

With controls

AlertControls as a direct child of Alert puts the actions top-right, which is what a wide alert wants. The buttons are always secondary and small, neutral or destructive to match the alert, never a solid primary.

With bottom actions

The same controls nested inside AlertContent drop below the text instead, which is what a narrow alert wants. Placement follows the width rather than a rule.

Min max width

Each row puts the alert in a container that crosses one of its bounds, since neither is visible in a container that sits between them. The alert has no width of its own: it takes the container's, clamped between 256 and 980px.

Max lines

lineClamp is opt-in: without it long text wraps freely, and with it the text truncates and the full string moves into a tooltip. Four lines is the usual cap.

With code

An inline Code line inside the content, for the error code or the command that failed — the one piece of rich content an alert is built to carry.

Props

PropTypeDefaultDescription
colorAlertColor | undefinedprimaryColor variant of the alert
minWidthnumber | undefinedALERT_MIN_WIDTHMinimum width in pixels (default: 256)
maxWidthnumber | undefinedALERT_MAX_WIDTHMaximum width in pixels (default: 980)
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
data-testidstring | undefined

AlertClose

PropTypeDefaultDescription
onClick(() => void) | undefinedCallback when the close button is clicked
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
type"button" | "submit" | "reset" | undefined
disabledboolean | undefined
namestring | undefined
valuestring | number | readonly string[] | undefined

AlertContent

PropTypeDefaultDescription
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
titlestring | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined

AlertControls

PropTypeDefaultDescription
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined

AlertDescription

PropTypeDefaultDescription
lineClampnumber | undefinedMaximum number of lines before truncation (default: 4). Set to 0 to disable truncation.
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined

AlertIcon

PropTypeDefaultDescription
iconReactNodeOverride the default icon for the variant
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined

AlertTitle

PropTypeDefaultDescription
lineClampnumber | undefinedMaximum number of lines before truncation (default: 4). Set to 0 to disable truncation.
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined

Explorer