Typed Confirm
A confirmation for deleting something that takes other things with it. The phrase shown above the field lights up as it is typed and marks the first wrong character, a line fills with the match, the list of consequences rolls its counts in, and the button unlocks only on an exact match.
pixikit.com/docs/app-ui/overlays/typed-confirm
Customize
Default open
Case sensitive
Allow paste
Portal
Props
15| 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. |
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. |
phrase | string | Required | What must be typed, usually the name of the thing being deleted. |
caseSensitive | boolean | false | Whether capital letters must match. |
consequences | TypedConfirmConsequence[] | None | What will be lost, one line each. |
acknowledgements | string[] | None | Checkboxes that must all be ticked before the button unlocks. |
confirmLabel | string | "Delete" | The confirm 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. |
allowPaste | boolean | false | Lets the phrase be pasted into the field, and the phrase above it be selected. |
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. |