Verdict Dialog
A confirmation dialog that waits for the result. The icon draws itself, the buttons lock while the action runs, success turns the icon into a check, and a failure shakes the dialog and offers Retry. It can hold the confirm button behind a countdown and remember a Do not ask again choice.
pixikit.com/docs/app-ui/overlays/verdict-dialog
Customize
Default open
Tone
Layout
Actions
Countdown0s
Portal
Props
18| Name | Type | Default | Description |
|---|---|---|---|
trigger | ReactNode | None | What the trigger button shows. Leave it out to open the dialog with `open` instead. |
open | boolean | None | Whether the dialog is open, when you hold the state. |
defaultOpen | boolean | None | Whether the dialog is open at first, when the dialog holds the state. |
onOpenChange | (open: boolean) => void | None | Called with the next open state. |
tone | VerdictTone | "default" | Sets the icon, which draws itself, and the confirm button's colour. |
title | string | None | The heading; it names the dialog for screen readers. |
description | string | None | A line under the title; it describes the dialog for screen readers. |
children | ReactNode | None | Extra content under the description, such as a list of what will be affected. |
confirmLabel | string | "Confirm" | The confirm button's label. |
cancelLabel | string | "Cancel" | The cancel button's label. |
onConfirm | () => void | Promise<void> | None | Runs on confirm. While it runs the dialog is locked; when it resolves the icon turns into a check and the dialog closes; when it rejects the dialog shakes, shows the message and offers Retry. |
onCancel | () => void | None | Called when the dialog is cancelled by the button, Escape or the backdrop. |
layout | "centered" | "start" | "centered" | An icon above centred text, or an icon beside text that starts at the left. |
actions | "end" | "stretch" | "stacked" | "end" | Buttons at the end, side by side across the width, or stacked with confirm on top. |
countdown | number | 0 | Seconds before the confirm button works; a ring runs down on it. 0 turns it off. |
dontAskKey | string | None | Adds a "Do not ask again" checkbox. Once ticked and confirmed, the choice is kept in localStorage under this key and `onConfirm` runs at once without opening. |
portal | boolean | true | Renders in a portal on the page body and locks page scroll; turn off to fill the nearest positioned parent instead. |
className | string | None | Extra classes for the dialog panel. |