Type to Confirm

Type to Confirm is a copy-paste React component that stops wrong repo deleted on reflex before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/type-to-confirm
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsWrong repo deleted on reflex

Was this component page useful?

How do I install Type to Confirm?

pnpm dlx shadcn@latest add @bollard/type-to-confirm

The files land in your project. They're yours to edit.

How do I use Type to Confirm in React?

type-to-confirm-usage.tsx
import { TypeToConfirm } from "@/components/ui/type-to-confirm"

<TypeToConfirm
  open={open}
  onOpenChange={setOpen}
  phrase="acme/website"
  description="This permanently deletes the repository, its wiki, issues and comments."
  confirmLabel="Delete this repository"
  onConfirm={async () => {
    await new Promise((resolve) => setTimeout(resolve, 800))
    setDeleted(true)
  }}
/>

What input mistakes does Type to Confirm catch?

  • Confirming before the exact phrase is typed
  • A typo, flagged at the first mismatching character
  • Failed confirms, which keep the dialog open with the error
  • Repeat confirms while pending

What props does Type to Confirm accept?

TypeToConfirm props
PropTypeDefault
open

Controlled open state.

boolean—
defaultOpen

Initial open state when uncontrolled.

booleanfalse
onOpenChange

Called when the dialog opens or closes.

(open: boolean) => void—
phrase* (required)

The exact phrase the user has to type, e.g. the repository name.

string—
title

Dialog title.

React.ReactNode"Are you absolutely sure?"
description

Dialog description: what will be deleted and what can't be undone.

React.ReactNode"This action cannot be undone."
onConfirm* (required)

Runs when the user confirms. Return a promise to show a pending state; a rejection keeps the dialog open with its message.

() => void | Promise<void>—
instruction

Label for the input. Receives the phrase, already styled.

(phrase: React.ReactNode) => React.ReactNode(p) => <>Type {p} to confirm.</>
mismatchHint

Shown under the input once the typing stops matching.

string"That doesn't match yet. Check for typos."
confirmLabel

Label of the confirm button.

React.ReactNode"Delete"
pendingLabel

Confirm label while onConfirm runs.

React.ReactNode"Deleting…"
cancelLabel

Label of the Cancel button.

React.ReactNode"Cancel"
errorMessage

Fallback when `onConfirm` rejects without an Error message.

string"That didn't go through. Try again."

* required. Also accepts the native props of <dialog> (className, aria-*, data-*…), passed through to it.

How is Type to Confirm accessible?

  • Native <dialog> labelled and described by its title and description
  • Input has a <label>, autoFocus, aria-invalid and a polite hint
  • Confirm uses aria-disabled (stays discoverable) and aria-busy while pending
  • Errors use role=alert

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Authorize the destructive action server-side and confirm the target id there; the typed phrase is a UX guard only.

  • Case-sensitive exact match after trimming leading and trailing spaces
  • Typing a name proves attention, not authorization
  • Make the phrase the real target (repo, env, account) so it names what's at stake

What expensive mistakes does Type to Confirm stop?

Wrong repo deleted on reflex

Also known as

type to confirm · delete repository · delete project · github style · confirmation dialog · modal · danger zone

Field type

What dependencies does Type to Confirm require?

Type to Confirm facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameType to Confirm
Registry identifier@bollard/type-to-confirm
Install commandnpx shadcn@latest add @bollard/type-to-confirm
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Type to Confirm

How does Type to Confirm protect destructive mutations?

Type to Confirm prevents wrong repo deleted on reflex. Enforces deliberate friction against Confirming before the exact phrase is typed, A typo, flagged at the first mismatching character, Failed confirms, which keep the dialog open with the error, Repeat confirms while pending. Limitation: authorize type-to-confirm mutations on the server.

How do I install type-to-confirm with shadcn?

Run `npx shadcn@latest add @bollard/type-to-confirm`. Sources added: registry/default/type-to-confirm/type-to-confirm.tsx. Package requirements: lucide-react.

What props customize Type to Confirm?

Type to Confirm accepts `open`, `defaultOpen`, `onOpenChange`, `phrase`, `title`. Configures type to confirm, delete repository, delete project behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of type-to-confirm?

Case-sensitive exact match after trimming leading and trailing spaces. Typing a name proves attention, not authorization. Make the phrase the real target (repo, env, account) so it names what's at stake Server requirement: Authorize the destructive action server-side and confirm the target id there; the typed phrase is a UX guard only.

How does Type to Confirm meet accessibility guidelines?

Native <dialog> labelled and described by its title and description. Input has a <label>, autoFocus, aria-invalid and a polite hint. Confirm uses aria-disabled (stays discoverable) and aria-busy while pending. Errors use role=alert. Minimizes errors: deleted wrong project, type name to delete.

Which components pair with Type to Confirm?