Skip to content
PixiKit

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
NameTypeDefaultDescription
triggerReactNodeNoneWhat the trigger button shows. Leave it out to open the dialog with `open` instead.
openbooleanNoneWhether the dialog is open, when you hold the state.
defaultOpenbooleanNoneWhether the dialog is open at first, when the dialog holds the state.
onOpenChange(open: boolean) => voidNoneCalled with the next open state.
toneVerdictTone"default"Sets the icon, which draws itself, and the confirm button's colour.
titlestringNoneThe heading; it names the dialog for screen readers.
descriptionstringNoneA line under the title; it describes the dialog for screen readers.
childrenReactNodeNoneExtra content under the description, such as a list of what will be affected.
confirmLabelstring"Confirm"The confirm button's label.
cancelLabelstring"Cancel"The cancel button's label.
onConfirm() => void | Promise<void>NoneRuns 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() => voidNoneCalled 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.
countdownnumber0Seconds before the confirm button works; a ring runs down on it. 0 turns it off.
dontAskKeystringNoneAdds 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.
portalbooleantrueRenders in a portal on the page body and locks page scroll; turn off to fill the nearest positioned parent instead.
classNamestringNoneExtra classes for the dialog panel.

More overlays blocks in Pro

View all

Related