Command Palette

Search for a command to run...

Confirmer

Imperative confirm dialog implementation.

Installation

Run the following command:

pnpm dlx shadcn@latest add https://ui-x.junwen-k.dev/r/confirmer.json

Add the <Confirmer /> component.

app/layout.tsx
import { Confirmer } from "@/components/ui/confirmer"; 
 
export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <head />
      <body>
        <main>{children}</main>
        <Confirmer /> 
      </body>
    </html>
  );
}

Usage

import { confirm } from "@/components/ui/confirmer";
confirm({
  title: "Are you absolutely sure?",
  description:
    "This action cannot be undone. This will permanently delete your account and remove your data from our servers.",
}).then((confirmed) => {
  // ...
});

Examples

Default