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
| Prop | Type | Default | Description |
|---|---|---|---|
tone | "info" | "success" | "warning" | "danger" | "neutral" | — | Semantic colour of the displayed content. Defaults to "info". |
title / children / action | ReactNode | — | title: Heading shown above the content. Defaults to no heading. children: What happened and what to do. action: Buttons or links: Retry, Update card. |
icon | ReactNode | false | — | Replace the tone's icon, or false for none. |
open / onDismiss | boolean / () => 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 / ref | CSSProperties / 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. |
classNames | AlertClassNames | — | Classes for the named visual parts; no part overrides by default. |
defaultOpen | boolean | — | Initial visibility when uncontrolled; defaults to true. |
onOpenChange | (open: boolean) => void | — | Reports a request to close; no callback by default. |
dismissible | boolean | — | Shows a close button; defaults to whether onDismiss or onOpenChange is supplied. |
title | ReactNode | — | Heading shown above the content. Defaults to no heading. |
children | ReactNode | — | What happened and what to do. |
action | ReactNode | — | Buttons or links: Retry, Update card. |
open | boolean | — | Controlled visibility; omitted by default to keep visibility locally. |
onDismiss | (() => void) | — | Adds a close button; the alert folds away when open turns false. |
className | string | — | Classes on the documented visual root; no override by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented root element; no ref by default. |
Built from
Used in
- Analytics dashboard
- API keys & webhooks
- Appointment book
- Artifact workbench
- Asset workspace
- Automation runs
- Automation steps
- Billing & invoices
- Billing desk
- Services and hours
- Budget month
- Bulk item edit
- Captions
- Change orders
- Insurance claims
- Book an appointment
- Company access
- Condition checklist
- Contact profile
- Course builder
- Course dashboard
- Course home
- Dashboard panels
- Dispensing
- Document review
- Estimate share
- Field conditions
- File detail
- File manager
- Grading desk
- Guest messages
- Helpdesk inbox
- Inspection review
- Inventory finder
- Invoices
- Item setup
- Job materials
- Kit builder
- Lease renewals
- Lease setup
- Link booking
- Maintenance plans
- Model playground
- Note templates
- Notification preferences
- Order board
- Order closeout
- Order ledger
- Orders admin
- Owner records
- Pack station
- Page inline edit
- Parts tracker
- Patient chart
- Policy rules
- Product analytics
- Production and lots
- Program setup
- Project board
- Projects
- Purchase order desk
- Purchase request
- Purchasing rules
- Question builder
- Record sharing
- Record versions
- Recruiter home
- Report builder
- Report library
- Rooms & equipment
- Restock desk
- Results notebook
- Return case
- Return queue
- Return request
- Route plan
- Sales dashboard
- Schema fields
- Service estimate
- Session replay
- Settings
- Shipment split
- Social media scheduler
- Stage reports
- Status dashboard
- Step form
- Stock alerts
- Stock moves
- Submittal register
- Team calendar
- Team chat
- Training progress
- Transaction review
- Translation editor
- Voice agent
- Waitlist desk
- Workflow builder
- Workout logger
- Workout planner
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.