Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Simple Information Alert Alert Dialog for Solid

A one-button notice titled System Update, saying an update will install in the next maintenance window.

UI library: Ark UI

The title is System Update. The text says the update installs in the next maintenance window. OK is the only button. It does not install anything.

Use one button when there is no decision. Add cancel if people must choose. A note that should not take over the page is an Alert. In Solid, Ark UI does not schedule the update.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Alert Dialog anatomy: content, title, description, cancel, action

Usage

<AlertDialog>
    <AlertDialogTrigger asChild={props => <Button {...props()} variant="outline">Show Info</Button>} />
    <AlertDialogContent>
      <AlertDialogHeader>
        <AlertDialogTitle>System Update</AlertDialogTitle>
        <AlertDialogDescription>
          A new system update is available. The update will be installed during
          the next maintenance window.
        </AlertDialogDescription>
      </AlertDialogHeader>
      <AlertDialogFooter>
        <AlertDialogClose asChild={props => <AlertDialogAction {...props()}>OK</AlertDialogAction>} />
      </AlertDialogFooter>
    </AlertDialogContent>
  </AlertDialog>

FAQ

Alert dialog or toast?

A dialog for information people must acknowledge, like changes to their workflow. A toast for FYI messages they can ignore, like Settings saved.

Why an Alert Dialog instead of a Dialog?

It stays open until people acknowledge it: no close button, no closing on a click outside. A Dialog suits content people may dismiss at any time.

When should it appear?

When it's relevant to what people are doing, or when it's urgent. Not on every page load, or people learn to click OK without reading.

How often?

Once per message per person. Remember dismissals so the same notice doesn't come back.

How much text?

Two or three sentences. Link to details if there's more.

Does OK close the dialog?

Yes.

API Reference

Alert Dialog

Sets asChild and props. The rest is on the Alert Dialog page.

Button

Sets props and variant="outline". The rest is on the Button page.