A shadcn-style alert dialog component built with Ark UI primitives.

Installation

npx shadcn@latest add @ark-cn/alert-dialog

Usage

import * as AlertDialog from "@/components/ui/alert-dialog"

Read exported parts in src/components/ui/alert-dialog.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Alert Dialog

Close Confirmation

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

AlertDialogPopup

PropTypeDescription
backdropClassName?stringExtra class for the backdrop element.
bottomStickOnMobile?booleanBottom-aligned positioner on small screens instead of centered.
positionerClassName?stringExtra class on the positioner wrapper.
size?"default" | "sm"Preset max-width for the content shell.

AlertDialogFooter

PropTypeDescription
variant?"default" | "bare"Bordered/muted footer bar vs minimal padding only.

AlertDialogCancel

PropTypeDescription
variant?ButtonVariantButton style preset for the cancel trigger (default ghost).

AlertDialogAction

PropTypeDescription
variant?ButtonVariantButton style preset for the action trigger.

See the ARK UI documentation for the full API.