Skip to content

AlertDialogRoot

Open .md
Live preview

Loading example…

Root of a composed alert dialog; owns the open state and the focus return.

import { AlertDialogRoot } from "@jcsoftdev/ui/overlays";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/overlays/alert-dialog.

<AlertDialogRoot
trigger={<Button variant="danger">Delete appointment</Button>}
title="Delete this appointment?"
description="Marco Salazar will be notified and the slot becomes free."
confirmLabel="Delete"
tone="danger"
/>
Prop Type Default Description
open boolean
defaultOpen boolean false
onOpenChange ((open: boolean) => void)
children ReactNode AlertDialog.Trigger and AlertDialog.Content.

* marks a required prop.

packages/ui/src/overlays/alert-dialog/alert-dialog.tsx