Alert: Variants
variant colors only the icon, so the surface stays neutral and status reads at a glance without shouting.
Heads up
You can add components to your app using the CLI.
Payment failed
Your card was declined. Update your billing details.
Changes saved
Your profile is now visible to your team.
New version available
Reload the page to get the latest features.
Trial ends in 3 days
Add a payment method to keep your workspace active.
This adds the example as components/examples/alert/variants.tsx, together with the Alert component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/alert-variants.jsonTo add only the component, follow the Alert installation.
Props in this example
The Alert props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
variantColors the icon. destructive and warning are announced assertively. | "default" | "destructive" | "success" | "info" | "warning" | "default" |
Every prop is in the Alert API reference.
- Soft
- Partial content
- Actions
- Dismissible
- Controlled
- Cancel a dismiss
- Inserted after load
- Rich content
- Right to left
See them all, with keyboard support and accessibility notes, on the Alert page.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- EmptyA placeholder for screens with nothing to show yet, with an icon, a message and the next action.
- ProgressA bar or ring that shows how far a task has come, eases between updates and slides while the total is unknown.
- SkeletonPlaceholders that wait 150ms before showing, take the exact size of the content they wrap, and fade it in without moving anything.
- SpinnerA loading indicator with Apple-style ticks or a breathing ring that can wait before showing and stay long enough not to flicker.