# Components Alert: Dismissible Alerts

Alerts with a close button so users can clear a notice once read. Use for cookie banners, promotions, and warnings that should not stay forever.

- Page: https://www.shadcn-ui-blocks.com/blocks/components/alerts/dismissible-alerts
- Collection: [Components](https://www.shadcn-ui-blocks.com/blocks/components), Free tier
- Group: [Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts)
- Created: 2026-06-14
- Preview image: https://www.shadcn-ui-blocks.com/blocks/components/alerts/dismissible-alerts.png

## Install

```bash
npx shadcn@latest add @shadcn-ui-blocks/components-alerts-dismissible-alerts
```

A free block: it installs with no account or key. Or install it by URL: `npx shadcn@latest add "https://www.shadcn-ui-blocks.com/r/components-alerts-dismissible-alerts.json"`.

## Depends on

- npm packages: class-variance-authority, lucide-react, radix-ui
- shadcn/ui components: alert, button
- Installs to: `@/components/blocks/components/alerts/dismissible-alerts`

## About this block

Dismissible Alerts is a stacked set of five notices, each carrying a
title, a short description, and an X button anchored to the top right
corner. The five variants are default, destructive, success, warning,
and info. Each has a matching icon and color treatment so the tone is
clear at a glance. When a user closes an alert it disappears from the
stack, and a Reset Alerts button appears below so all five can be
restored in one click.

Every alert is independent. You can keep only the variants your product
needs, swap the titles and descriptions freely, and remove the reset
button entirely for a production build where dismissed notices stay gone.

## When to use

Reach for this block when notices should clear out of the way once a
user has acknowledged them. It suits a real estate marketplace well:
a success alert confirming a saved search, a warning that a listing
price recently dropped, and an info alert about a new open house can
each be dismissed as the user works through their dashboard without
the page filling up with stale notices.

A natural flow around it on a Components page:

**Before**

- [Basic Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/basic-alerts) to show the
  same tone set in a static form before adding dismiss behavior
- [Badges](https://www.shadcn-ui-blocks.com/blocks/components/badges) to label the status categories
  your alerts will cover

**After**

- [Cards](https://www.shadcn-ui-blocks.com/blocks/components/cards) to house richer content once a
  user acts on a notice
- [Compact Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/compact-alerts) for
  follow-up messages in tight spaces after the primary notice clears

## What you can customize

Five ready-to-use tonal variants with close buttons that cover the
most common notice scenarios. A few ways to adapt the set:

- **Variant selection.** Keep only the variants your flows require
  and drop the rest so the stack stays focused.
- **Copy and icons.** Each alert title and description is independent,
  so you can tailor the message to the exact event without touching
  the other cards.
- **Reset behavior.** The reset button is shown only when at least one
  alert has been closed, making it useful in demos or settings pages
  where users should be able to undo a dismiss.

> Tip: in production, wire each close handler to persist the dismissed
> state so the notice stays gone on page reload rather than reappearing
> every visit.

## More in Components Alerts

- [Accent Border Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/accent-border-alerts)
- [All Sides Accent Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/all-sides-accent-alerts)
- [Basic Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/basic-alerts)
- [Bottom Accent Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/bottom-accent-alerts)
- [Compact Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/compact-alerts)
- [Dashed Border Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/dashed-border-alerts)
- [Dotted Border Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/dotted-border-alerts)
- [Double Border Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/double-border-alerts)
- [Elevated Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/elevated-alerts)
- [Frosted Glass Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/frosted-glass-alerts)
- [Glow Border Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/glow-border-alerts)
- [Icon Only Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/icon-only-alerts)
- [Inset Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/inset-alerts)
- [Monospace Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/monospace-alerts)
- [Outlined Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/outlined-alerts)
- [Paper Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/paper-alerts)
- [Pulse Border Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/pulse-border-alerts)
- [Right Accent Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/right-accent-alerts)
- [Top Accent Alerts](https://www.shadcn-ui-blocks.com/blocks/components/alerts/top-accent-alerts)
