Alert

A React component in Beamline's Feedback category, in the free sample.

A message that stays until it is dealt with: what happened, what to do, an action; danger and warning are announced; dismissing folds its height away.

Use it for

  • Persistent problems or notices on a page: failing webhook, expiring card, maintenance.

Not for

  • Brief results of an action (toast).
  • Field errors (under the field).

Anatomy

  • wrap (folds on dismiss)
  • alert (m-surface; tone tint composed over the role's fill)
  • icon (tone colour)
  • title
  • body
  • actions
  • dismiss (ghost icon Button sm)

States

  • arriving (grows to its height)
  • shown
  • tone changed (tint blends, the new glyph arrives)
  • folding away

Keyboard

  • Dismiss is a button

Motion

An alert grows to its height as it appears (so what sits below glides) and dismissing folds it back to zero, both with a fade over --pui-duration-standard; it then unmounts. A change of tone blends the tint (a registered colour) and the new glyph arrives from a little smaller. Reduced motion is instant (the glyph fades). Nothing moves at rest.

Props

PropTypeDefaultDescription
tone"info" | "success" | "warning" | "danger" | "neutral"—Semantic colour of the displayed content. Defaults to "info".
title / children / actionReactNode—title: Heading shown above the content. Defaults to no heading. children: What happened and what to do. action: Buttons or links: Retry, Update card.
iconReactNode | false—Replace the tone's icon, or false for none.
open / onDismissboolean / () => void—open: Controlled visibility; omitted by default to keep visibility locally. onDismiss: Adds a close button; the alert folds away when open turns false.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
classNamesAlertClassNames—Classes for the named visual parts; no part overrides by default.
defaultOpenboolean—Initial visibility when uncontrolled; defaults to true.
onOpenChange(open: boolean) => void—Reports a request to close; no callback by default.
dismissibleboolean—Shows a close button; defaults to whether onDismiss or onOpenChange is supplied.
titleReactNode—Heading shown above the content. Defaults to no heading.
childrenReactNode—What happened and what to do.
actionReactNode—Buttons or links: Retry, Update card.
openboolean—Controlled visibility; omitted by default to keep visibility locally.
onDismiss(() => void)—Adds a close button; the alert folds away when open turns false.
classNamestring—Classes on the documented visual root; no override by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.

Built from

Used in

Dependencies

lucide-react

Import

import { Alert } from "@beamline/alert";

Get it

Alert is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Alert is included in the free MIT sample. Get Beamline · Connect your agent

More in Feedback

  • Timer: A duration that counts down (or up) from your clock: Start, Pause, Resume, Reset and the finish reported once; the time left drawn as a bar you drag (or…
  • Notification centre: Updates that wait to be read: a bell with the unread count opens All / Unread, new and earlier groups, and per item mark read or dismiss.
  • Usage meter: An allowance and what fills it: one bar split by source, the room left, a warning near the limit and the overflow in its own red well past a notch at the…
  • Cookie consent: Asks once which cookies a visitor allows, with Reject all and Accept all given equal weight; Customise grows the notice in place into each category with…
  • Empty state: What a place will hold and the first step to fill it, instead of a blank; a compact size for panels and filtered tables.
  • Spinner: A ring that spins while work runs and closes into a drawn check or cross when it ends.
  • Announcement bar: A banner across the top for news and offers: messages take turns, a countdown ticks, and dismissing folds it away and can remember it.
  • Progress: How much of a known task is done, or a moving bar when the length is unknown, with an optional label and value.
  • Skeleton: Holds the shape of content while it loads, then crossfades into it, so nothing jumps.

Guides: Evaluate Beamline UI with a settings screen and real data

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.