Components

Dialog

Modal dialogs on the native <dialog> element, and a confirmation for destructive actions.

Rename category

Entries in this category keep their history.

Import

import { Dialog, ConfirmDialog } from '@rinzai/zen';

Examples

Delete this goal?

Its progress history is removed too. This can't be undone.

API reference

<Dialog>

Modal dialog on the native <dialog> element: focus is trapped and restored, the page behind is inert, and Escape closes it. `dismissible={false}` is for flows the user must finish (no Escape or outside-click close).

PropTypeDefault
openRequired
boolean—
titleRequired
ReactNode—
className
string—
description
ReactNode—
dismissible
booleantrue
initialFocus

Element to focus when the dialog opens (default: the first focusable one).

RefObject<HTMLElement | null>—
onOpenChange
((open: boolean) => void)—
role
AriaRole—
size

"lg" for dialogs holding a whole tool rather than a short form.

"lg" | "md"md

<ConfirmDialog>

Confirmation for destructive or irreversible actions. Cancel has focus, so Enter is the safe choice.

PropTypeDefault
confirmLabelRequired
string—
onConfirmRequired
() => void—
onOpenChangeRequired
(open: boolean) => void—
openRequired
boolean—
titleRequired
ReactNode—
cancelLabel
stringCancel
description
ReactNode—
destructive
booleanfalse