Skip to main content
BlocksDialogsSuccess confirmation with single action

shadcn/ui Dialogs block for Base UISuccess confirmation with single action

A centred success dialog built with shadcn/ui Dialog, DialogHeader, DialogDescription, DialogFooter and Button. A round icon badge sits above the title and a single full-width DialogClose button returns the user to the previous screen. Ideal for confirming a completed publish, payment or submission.

Free@shadcnpro/base/dialog-01

Preview

Installation

npx shadcn@latest add @shadcnpro/base/dialog-01

First time? Add the @shadcnpro registry to components.json as shown in Installation. Free blocks install without a license key.

Let your AI editor install it

The shadcn/ui Pro MCP server lets Cursor, Claude Code and VS Code find and install blocks like Success confirmation with single action from one prompt. It is included in every Pro plan.

Add the shadcn/ui components

Success confirmation with single action uses Button and Dialog, from the Base UI components set up in your components.json.

npx shadcn@latest add button dialog

Install the npm packages

npm install lucide-react

Copy the code

Paste it into components/blocks/dialog-01.tsx.

components/blocks/dialog-01.tsx
'use client';

import { CheckIcon } from 'lucide-react';
import { useState } from 'react';
import { Button } from '@/components/ui/button';
import {
  Dialog,
  DialogClose,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from '@/components/ui/dialog';

/**
 * Success confirmation dialog with a single primary action.
 */
export default function Dialog01() {
  const [open, setOpen] = useState(true);

  return (
    <Dialog onOpenChange={setOpen} open={open}>
      <DialogTrigger render={<Button variant="outline" />}>
        Publish episode
      </DialogTrigger>

      <DialogContent className="sm:max-w-sm">
        <div className="flex justify-center">
          <div className="mx-auto flex size-12 items-center justify-center rounded-full bg-primary/10">
            <CheckIcon className="size-6 text-primary" />
          </div>
        </div>

        <DialogHeader className="gap-0 text-center">
          <DialogTitle className="text-balance text-center">
            Episode published
          </DialogTitle>
          <DialogDescription className="mx-auto mt-2 text-pretty text-center sm:max-w-[90%]">
            &ldquo;Why ports are the new data centers&rdquo; is live on Kestrel
            and is being pushed to Spotify, Apple Podcasts and your RSS feed.
          </DialogDescription>
        </DialogHeader>
        <DialogFooter className="sm:justify-center">
          <DialogClose render={<Button className="w-full" />}>
            Back to episodes
          </DialogClose>
        </DialogFooter>
      </DialogContent>
    </Dialog>
  );
}

Use it

Import it where you need it and update the import path to match your project.

Usage
import Dialog01 from '@/components/blocks/dialog-01';

export default function Page() {
  return <Dialog01 />;
}

Overview

Success confirmation with single action is a free dialogs block for shadcn/ui and Base UI. It is built from the Button and Dialog components with lucide-react, and installs as a single file you own and can edit.

It only uses semantic tokens such as bg-background, text-muted-foreground and border-border, so it follows your theme, radius and fonts and switches with dark mode. It is responsive from desktop to mobile; the width controls above the preview show each size. The same layout is in the shadcn/ui Pro Figma kit, so design and code start from one source.

Category
Dialogs
Component library
Base UI (@base-ui/react)
Also available for
Radix UI, React Aria
Built with
Button and Dialog
npm packages
lucide-react
Files
components/blocks/dialog-01.tsx
Access
Free, installs without a license key

Frequently asked questions

Pricing, installation and Base UI details for Success confirmation with single action.