Alert

Alert is a neobrutalist React component from Cruise UI. Info, success, warning and danger messages with a square icon chip; a full-width banner variant. Install it with npx shadcn@latest add @cruiseui/alert.

Install

Terminal

npx shadcn@latest add @cruiseui/alert

First time? Installation shows the one-off components.json setup (the @cruiseui registry) and how to turn the theme on.

Example

Corners

Delivery is free this week

Orders over ₦10,000 in Lagos ship free until Sunday.

Payment received

We've sent your receipt to your email.

Your card expires soon

Update it before the 30th to keep your plan.

When to use it

When to use

A message about the page or an action that people should see without it disappearing.

When not to

Short-lived feedback after an action (use a Toast). Field errors (use a FormField).

Props

CruiseAlert

PropTypeDefaultDescription
tone?CruiseAlertTone"info"—
titleReactNode——
children?ReactNode——
action?ReactNode—A button or link, e.g. "Try again".
onDismiss?(() => void)—Shows the dismiss "X" (aria-label="Dismiss").
banner?booleanfalseFull width, no corners or shadow: for the top of a page.
className?string——

Accessibility

  • role="alert" only for danger (it interrupts); role="status" for the others.
  • The tone has an icon and a title, not colour alone.
  • The dismiss button has aria-label="Dismiss".