Overlayssrc/components/ui/alert-dialog.tsx

Alert Dialog

A modal confirmation dialog for destructive or important actions.

Preview

Installation

Copy the component source into your project with `degit`. This port is intentionally not distributed as an npm package.

bunx degit https://github.com/LiasCode/shadcn-preact/src/components/ui#main ./src/components/ui

Usage

import {
  AlertDialog,
  AlertDialogTrigger,
  AlertDialogContent,
  AlertDialogHeader,
  AlertDialogFooter
} from "@/components/ui/alert-dialog"

export function Example() {
  return (
    <AlertDialog>
      {/* compose the parts you need */}
    </AlertDialog>
  )
}

API Reference

ExportPurpose
AlertDialogComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogTriggerComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogContentComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogHeaderComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogFooterComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogTitleComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogDescriptionComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogActionComposable part exported by `@/components/ui/alert-dialog`.
AlertDialogCancelComposable part exported by `@/components/ui/alert-dialog`.