dimah-s3v0.4.1

Delete

DeleteButton — a shadcn-styled button with a built-in confirmation dialog.

Preview

Install

npm i @dimah-s3/ui shadcn
app/globals.css
@import "shadcn/tailwind.css";
@import "@dimah-s3/ui/styles.css";

/* + shadcn theme variables */

shadcn theme variables must be in globals.css.

Mount the toaster once in your root layout:

app/layout.tsx
import { Toaster } from "@dimah-s3/ui";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Toaster />
      </body>
    </html>
  );
}

Already using shadcn toast for your own messages? Mount both — rename one import (Toaster as DimahToaster). They are independent; your code keeps import { toast } from "@/components/ui/toast" and toast.add({ … }).

Props

Prop

Type

Wire onSuccess to a database mutation to keep your records in sync after deletion.

Headless alternative

Use useDelete directly for custom confirmation UIs.

On this page