Alert
NEWAn alert component that collapses smoothly in height and opacity on dismissal, with tone-aware icons, action slot, and accessibility roles.
Operation successful
Your components have been deployed cleanly to production.
Subscription renewing soon
Your team plan will automatically renew in 3 days.
Payment failed
Your card was declined. Content collapses smoothly when dismissed.
Installation
Add the component directly to your repository using shadcn CLI:
npx shadcn@latest add Surajmaurya1/easyui/alert
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'neutral' | Color tone and severity semantic level |
| icon | React.ReactNode | false | undefined | Custom icon element, or false to suppress icon |
| dismissible | boolean | false | Renders an interactive close button |
| onDismiss | () => void | undefined | Callback invoked after the exit collapse animation completes |
| action | React.ReactNode | undefined | Optional right-hand action element (e.g. action button) |
| className | string | undefined | Additional CSS classes for the alert container |