Skip to content
Feedback

Alert Dialog

Confirm a destructive action.

Import

tsx
import { AlertDialog } from "@cronus-ui/ui";
bash
npx cronus-ui add alert-dialog

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component AlertDialogDefault layout:inline style:alert-dialog {
  label "Delete account"
  text "Confirm"
}

page "/audit/alert-dialog/default" type:custom {
  use AlertDialogDefault
}

API Reference

Generated from the component's exported types.

AlertDialogProps

Extends ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root>

Skip AlertDialogProps props table
PropTypeDefaultDescription
open
boolean—Controlled open state.
defaultOpen
boolean—Uncontrolled initial open state.
onOpenChange
(open: boolean) => void—Called when the open state changes.
children
ReactNode—Contents of the component.

AlertDialogTriggerProps

Extends ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Trigger>

Skip AlertDialogTriggerProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

AlertDialogContentProps

Extends ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>

Skip AlertDialogContentProps props table
PropTypeDefaultDescription
forceMount
boolean—Keep the node mounted when closed, for exit animation.
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

AlertDialogHeaderProps

Extends HTMLAttributes<HTMLDivElement>

Skip AlertDialogHeaderProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

AlertDialogFooterProps

Extends HTMLAttributes<HTMLDivElement>

Skip AlertDialogFooterProps props table
PropTypeDefaultDescription
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.

AlertDialogTitleProps

Extends ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>

Skip AlertDialogTitleProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

AlertDialogDescriptionProps

Extends ComponentPropsWithoutRef< typeof AlertDialogPrimitive.Description >

Skip AlertDialogDescriptionProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

AlertDialogActionProps

Extends ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>

Skip AlertDialogActionProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.

AlertDialogCancelProps

Extends ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>

Skip AlertDialogCancelProps props table
PropTypeDefaultDescription
asChild
boolean—Render as the child element via Slot.
children
ReactNode—Contents of the component.
className
string—Additional class names merged onto the root.