Docs Menu
Docs/Recipes/Destructive Delete Guard (Type to Confirm)
Updated October 2026

Destructive Delete Guard (Type to Confirm)

Protect critical resources by requiring the user to type the exact name before confirmation unlocks.

For critical cloud infrastructure or project deletions, require the user to explicitly type the project slug to unlock the confirm button.

typescript

export async function promptDeleteProject(projectName: string) { const res = await ui.prompt({ title: Delete "${projectName}"?, text: This action cannot be undone. Please type "${projectName}" to confirm:, input: 'text', placeholder: projectName, tone: 'danger', validate: (val) => { if (val !== projectName) { return Value does not match "${projectName}".; } return undefined; // valid }, preConfirm: async () => { await api.deleteProject(projectName); }, });

if (res.isConfirmed) { toast.error(Project ${projectName} deleted permanently.); } } `

Want to test these options live?

Launch the interactive playground to experiment with themes, positions, and live generators.

Open in Playground →