Skip to content
PixiKit

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
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.
titlestringNoneThe heading; it names the dialog for screen readers.
descriptionstringNoneA line under the title; it describes the dialog for screen readers.
phrasestringRequiredWhat must be typed, usually the name of the thing being deleted.
caseSensitivebooleanfalseWhether capital letters must match.
consequencesTypedConfirmConsequence[]NoneWhat will be lost, one line each.
acknowledgementsstring[]NoneCheckboxes that must all be ticked before the button unlocks.
confirmLabelstring"Delete"The confirm 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.
allowPastebooleanfalseLets the phrase be pasted into the field, and the phrase above it be selected.
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.

Related