Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Banner Stack Window Error Block for React

A banner stack in an on-call console window: a critical banner that cannot be dismissed, a warning and an info banner that fold away, and a Dismissed row that restores them, in a window that never changes height.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Rank the notices an app shows at once, with this banner stack block for React with Base UI. It's the console of Pagerlane, an on-call tool, drawn as an app window with a plus mark on each corner and a fixed height. The window's own top bar holds the heading; under it three Alert banners are stacked by weight. "Payments are failing" is critical: it can't be dismissed, its own sentence says it stays until payments recover, and it carries the block's one Shine Button, "View status". The warning and the info banner each have a dismiss button and fold away by their height. Under the stack, "Dismissed (n)" is a Collapsible that lists what was put away, each with a Restore button, and says so when nothing is. Below, a list of open incidents is the only part of the window that scrolls. It's built from Alert, Badge, Collapsible, Button, Shine Button and Guides, with CSS motion only. For consoles, dashboards and any app that has to show an outage over everything else.

FAQ

Why can't the critical banner be dismissed?

Because hiding the one notice about a live outage helps nobody. It has no dismiss button and its text gives the reason, so it doesn't look broken. Everything lower in weight can be put away, and the choice is typed in each banner's level: only critical has the Shine Button instead of a dismiss button. Keep a banner like it for failures that affect everyone, not for announcements.

How are the levels told apart without color?

By a word in a small Badge ("Critical", "Warning", "Info"), a different icon shape for each, and the critical banner's heavier edge. The one status color on the block is the critical icon; every word is in the text color, so the stack reads the same in every theme and for everyone.

What happens when I dismiss or restore a banner?

Dismissing folds the banner away by its height, keeps it in the page's markup but out of reach (it's inert and hidden) and moves focus to the "Dismissed" row, where a status line says what you put away. Restore brings it back and puts focus on its dismiss button. The window never changes height: the incident list takes or gives the room. Nothing is saved, so a reload brings all three back; in your app, store the dismissed ids (and don't store the critical one).

What scrolls, and is it reachable by keyboard?

Only the incident list scrolls. It holds nothing focusable, so the region itself is a tab stop with a name and a focus ring, and the arrow keys scroll it. The top bar, the banners and the status line never move.

Where do the times and the ages come from?

They are typed: each incident has an ISO start time, and AS_OF is a fixed "now", so "46 min" is the difference between them and reads the same on the server and in every time zone. In your app, replace AS_OF with the current time and refresh it on a timer you can pause.

  • Pro

    A full-height maintenance page for an online bank that shows a five-segment progress bar with the window's start and expected return, and a Check again button that reports a typed result.

  • Pro

    A maintenance notice for a payroll service as one framed panel: a clock you scrub through the 02:00 to 06:00 UTC window drives the time left, a progress bar and four tasks that read Done, Running or Queued.

  • Pro

    A full-height page for a web app tab running a retired version: a ruler of five releases with the supported range shaded and You are here marked, a radio group to read each release, three changes in 5.0 and a reload button.

  • Pro

    A full-height status page for cloud storage moving an account between regions: a drawn move whose dashes run three cycles, and an accordion of five steps that each say what they do and what stays available.

  • Pro

    A full-height page for a feature that is not on for your workspace yet: three conditions ruled from rail to rail, a rollout meter with the next wave, and a Switch that joins early access and flips the last condition.

  • Pro

    A dashboard window whose widgets fail on their own: orders that fail twice before loading, revenue from 3 of 5 sources with a details disclosure, a dismissible alert error, a recent errors list, and one Shine Button that retries what failed.