Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Alert Banner Login Block for React

A full-height sign-in page for a database host with a maintenance notice pinned above the form: a quiet alert with the window in UTC, a Details popover and a Dismiss that never moves the form.

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

Tell people about a maintenance window before they sign in, with this alert banner login block for React with Base UI. It's the sign-in of Tarnbase, managed database hosting: the page's side rails run the full height of the screen and one band crosses it between two rules. At the top of the band an Alert names the "Scheduled maintenance", the window as typed UTC times (Oct 20, 2026, 02:00 to 04:00 UTC), and says sign-in keeps working. A "Details" button opens a Popover with what pauses and what doesn't, and a named dismiss button folds the notice away. Under it come the product's mark, the heading and the plain form: a Field with an Input for the email, another with a Password Input, and the Shine Button that signs in, the only colored control. The notice's room is held, so dismissing it never moves the form, and "Maintenance notice hidden. Show it" at the foot brings it back. It's built from Alert, Popover, Field, Input, Password Input, Button, Shine Button and Guides, with a CSS entrance only. For any product with planned downtime.

FAQ

What stays in the page, and how do I drive the notice for real?

The window, the title and the Details text are typed constants, and the dismissed state lives only in the page: reload and the notice is back. Sign-in waits under a spinner for less than a second, then shows "You're signed in" and a polite status message says nothing was sent. To make it real, fetch the active incident or maintenance window from your status service or a feature flag when the page renders, remember the dismissal per incident (session storage is enough) so a new incident shows again, and post the form to your auth endpoint where the code says so.

Why is the notice a note and not an alert?

An alert interrupts a screen reader the moment it appears, and a scheduled window isn't urgent. The notice is a plain note that is read in its place, and the block's one polite status message speaks only what you do: hiding or showing the notice, then the sign-in result. An outage that is happening now is different: that one deserves an alert and, if sign-in is down, a way to keep people from trying.

Why doesn't the form move when I dismiss the notice?

The page is centered, so a notice that left the layout would shift the heading and the fields. Dismissing keeps the notice's room and only hides it, out of reach of the keyboard and screen readers, and the form stays where it was. Focus moves to "Show it" at the foot, and showing the notice moves focus back to its dismiss button, so Tab continues from the right place.

How does the Details popover behave?

It opens on a press, Enter or Space, closes on Escape or a press outside, and returns focus to the Details button. It holds a title, two sentences about what pauses (creating databases and restoring backups) and what does not (sign-in and running databases) and a link to the status page; point the link at yours.

Why are the times written in UTC?

The window is stored as two UTC instants and formatted with Intl.DateTimeFormat in UTC, so the server and every visitor's time zone print the same words, and the notice says UTC so nobody guesses. To show a visitor's local time too, compute it after mount and add it as a second line, so the first paint never differs from the server's.

Why is the Sign in button never disabled?

A disabled button can't explain itself, and keyboard users can't reach it. Pressing Sign in with an empty or malformed email, or no password, marks those fields invalid, writes one sentence under each and moves focus to the first. Typing clears that field's problem, and each field keeps a line for its problem even when there is none, so nothing moves when one appears.

  • Pro

    A full-height sign-in page for a team chat app: the product's mark, Google and GitHub rows with lettermark tiles, an or rule, email and password checked on submit, and one Sign in button with a simulated wait and its result.

  • Pro

    Session Expired Login

    Sessions and devices

    A re-authentication page for a document editor that keeps the email read-only, asks only for the password, shows where you were, and confirms before switching account.

  • Pro

    Account Locked Login

    Recovery and reset

    A locked-account page for a point-of-sale system that draws the lockout ladder, marks the rung the account is on with a fixed unlock time, and offers an unlock link by email or a password reset.

  • Pro

    A bare sign-in page for a plain-text notes app: a heading, one sentence, an email and a password written on a hairline and one Sign in button, set at the start of the page with no card, providers or footer.

  • Pro

    A full-height sign-in page for a password manager with four hairline cells under the form, each a button whose hover card says what the safeguard is and where it stops.

  • Pro

    A sign-in strip as a panel: a short header over one framed row with the product's mark, an email, a password and a Sign in button, which stack below 1024 px and swap for a row of the same height once signed in.