Components
Loading preview...
HeroUI AlertDialog for critical confirmations, with status icons, placements, backdrop variants, sizes, custom icons, dismiss behavior, controlled state and custom trigger examples. Uses the real @heroui/react component with bundled @heroui/styles CSS.
npx shadcn@latest add https://21st.dev/r/hero_ui/heroui-alert-dialog"use client"
import { AlertDialog } from "@/components/ui/heroui-alert-dialog"
import { Button } from "@heroui/react"
import { LockOpen } from "lucide-react"
export default function CustomIcon() {
return (
<AlertDialog>
<Button variant="secondary">Reset Password</Button>
<AlertDialog.Backdrop>
<AlertDialog.Container>
<AlertDialog.Dialog className="sm:max-w-[400px]">
<AlertDialog.CloseTrigger />
<AlertDialog.Header>
<AlertDialog.Icon status="warning"><LockOpen className="size-5" /></AlertDialog.Icon>
<AlertDialog.Heading>Reset your password?</AlertDialog.Heading>
</AlertDialog.Header>
<AlertDialog.Body>
<p>We'll send a password reset link to your email address. You'll need to create a new password to regain access to your account.</p>
</AlertDialog.Body>
<AlertDialog.Footer>
<Button slot="close" variant="tertiary">Cancel</Button>
<Button slot="close">Send Reset Link</Button>
</AlertDialog.Footer>
</AlertDialog.Dialog>
</AlertDialog.Container>
</AlertDialog.Backdrop>
</AlertDialog>
)
}