Back to components
ElementAlertFree

Alert Toast React component

A polished toast/alert notification, 5 tones, stacked or inline layout, icons, primary/secondary actions, dismiss and auto-dismiss, light/dark theme, plus a showcase mode rendering every variant side by side.

About the Alert Toast component

Alert Toast is a single notification card with a title, a description, an icon and optional buttons, in five tones: neutral, info, success, warning and error. It slides in when it appears, can show a colored accent bar on its left edge, and closes with its close button or by itself after a few seconds. The title and description can be stacked or sit side by side.

The props are grouped. content sets the title, description and layout. appearance sets the tone, a tinted or subtle background, the accent bar, the icon (none, info, success, error or a custom emoji), the light or dark theme and the corner radius. actions adds a primary and a secondary button with their labels, handled by onPrimaryClick and onSecondaryClick, and dismiss sets dismissible, autoDismiss and duration in seconds. onDismiss fires when it closes, and enterDelay delays its entrance.

When to use it

Use Alert Toast to confirm that something happened, like a saved form, a finished upload or a failed payment, without interrupting the flow. Five tones (neutral, info, success, warning, error) map to the usual message types, and optional primary and secondary actions handle an Undo or View link.

Turn on autoDismiss for routine confirmations; keep errors on screen until the visitor closes them.

Installation

Add the Alert Toast component to your project with the shadcn CLI. It lands in components/alert-toast.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/alert-toast

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Related components

Callout
Free
Menubar
Free
Sidebar
Free
Emoji Rating Scale
Free
Dock
Free
Inline Link Button
Free