Home Components Alerts
React Alert Components
30 free React alerts built with Tailwind CSS and shadcn/ui conventions. Copy the code or install with the shadcn CLI. Great for success, warning, error, and inline status messages.
Alert 1 : Single-line bordered alert with an info icon and a short message title.Alert 2 : Message notification with a sender avatar, a reply title and an unread count line.Alert 3 : Dismissible alert with a title, description and a close button that hides it.Alert 4 : Teal bordered single-line alert with an inline link that has a sliding arrow.Alert 5 : Square-cornered file warning with a red icon block attached to the left edge.Alert 6 : File warning with the alert icon inside a red rounded square avatar tile.Alert 7 : File upload alert with a cyan progress bar, Cancel and Upload another actions, and close button.Alert 8 : Dark primary filled update prompt with Later and Update now buttons and a close button.Alert 9 : Task assignment alert with an assigner avatar, task details and a yellow progress bar.Alert 10 : Dismissible email verification notice with a soft accent gradient fading top to bottom.Alert 11 : Green success alert with a thick left border accent and a user check icon.Alert 12 : Square red declined notice with a thick left border and a user remove icon.Alert 13 : Single-line message alert with a ghost Open button aligned to the right.Alert 14 : Error message using the built-in destructive alert variant with a warning icon.Alert 15 : Payment failure error with a red border and faint red background tint.Alert 16 : Minimal text-only alert on an accent background with no icon.Alert 17 : Default bordered alert with an icon, a bold title and a supporting description.Alert 18 : Sky blue info alert with a matching border, tinted background and description.Alert 19 : Green success alert with a check circle icon for confirming a placed order.Alert 20 : Yellow warning alert with border and tint for unstable connection messages.Alert 21 : Borderless alert on a faint primary tint listing supported upload file formats.Alert 22 : Borderless sky blue info callout giving upload format and size guidelines.Alert 23 : Borderless soft green success callout with a check icon for completed uploads.Alert 24 : Borderless soft yellow warning callout with an alert icon for large file uploads.Alert 25 : Borderless soft red error callout for a request that could not be completed.Alert 26 : Solid primary filled alert with inverted text for an unsaved settings reminder.Alert 27 : Solid green filled alert with white text confirming saved preferences.Alert 28 : Solid yellow filled alert with white text and a warning icon for incomplete setup.Alert 29 : Solid blue filled alert with white text announcing a profile visibility change.Alert 30 : Solid red filled alert with white text reporting a failed update.
About React Alert Components A React alert is a static message box that tells the user something important, like a success, a warning, or an error, without interrupting what they are doing. Watermelon UI alerts are built with Tailwind CSS and class-variance-authority, with default and destructive variants and role="alert" on the container. Add one with the shadcn CLI, then swap the icon and classes to match your design.
When to use it Form-level errors shown above a form after a failed submit. Billing, quota, or account warnings that should stay on a dashboard until resolved. Inline notices such as a scheduled maintenance window or a deprecated feature. When to use something else Use Sonner when the message is quick feedback on an action and should disappear on its own. Use Dialog when the user must confirm or act before they can continue. Use Badge when you only need a short status label next to an item. Frequently asked questions What is the difference between an alert and a toast? An alert sits in the page layout and stays until you remove it, while a toast floats over the page and usually closes itself after a few seconds. Use an alert for lasting context and a toast, such as Sonner, for quick feedback.
How do I show an error alert in shadcn? Pass variant="destructive" to the Alert component. It switches the text and icon to the destructive color token, which you can change in your Tailwind theme.
How do I make an alert dismissible? Keep a visible state in React and render a close button that sets it to false. The alert itself has no built-in close behavior, so you decide whether a dismissal is remembered.
Are shadcn alerts accessible? Yes. The container renders with role="alert", so screen readers announce it when it is added to the page. Keep the title short and put the detail in AlertDescription.
How to use React Alert Components Start from a React project with Tailwind CSS and shadcn/ui set up. Next.js, Vite, Remix, and Astro all work. Run npx shadcn@latest add https://registry.watermelon.sh/r/alert-1.json to add the source files to your project. Import it where you need it, then edit the Tailwind classes and design tokens to match your product. Dependencies installed with it: react-icons.
The code is yours: it lives in your repository, so there is no runtime package to keep updated. Watermelon UI is free and open source under the MIT license.
More: Free React components , UI library alternatives , guides .