Grace Send

Grace Send is a copy-paste React component that stops helps catch a send before second thoughts 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/grace-send
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

StopsHelps catch a send before second thoughts

Was this component page useful?

How do I install Grace Send?

pnpm dlx shadcn@latest add @bollard/grace-send

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

How do I use Grace Send in React?

grace-send-usage.tsx
import { GraceSend } from "@/components/ui/grace-send"

<GraceSend
  onSend={() =>
    new Promise<void>((resolve) =>
      setTimeout(() => {
        setLog("Sent to 84 people.")
        resolve()
      }, 800),
    )
  }
/>

What input mistakes does Grace Send catch?

  • Send pressed too early or by mistake
  • Leaving the page during the countdown (beforeunload warning)
  • Held Enter auto-repeating the press
  • Failed send surfaced with an alert

What props does Grace Send accept?

GraceSend props
PropTypeDefault
onSend* (required)

The irreversible action. Runs only after the grace window. Return a promise to show a pending state.

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

Called when the user cancels inside the window.

() => void—
delay

Length of the grace window, in milliseconds.

number5000
children

Idle button content.

React.ReactNode( <> <Send aria-hidden className="size-4" /> Send </> )
disabled

Disables the button.

boolean—
countdownLabel

Templates: `{s}` is the whole seconds left.

string"Sending in {s}s"
hint

Helper text under the button.

string"Press Escape to cancel."
cancelLabel

Cancel button text during the countdown.

string"Cancel"
sendNowLabel

Text of the button that skips the wait.

string"Send now"
pendingLabel

Shown while onSend's promise is pending.

string"Sending…"
sentLabel

Shown after onSend resolves.

string"Sent"
cancelledText

Announced when the user cancels.

string"Cancelled. Nothing was sent."
failedText

Shown when onSend rejects.

string"Couldn't send. Nothing went out, so you can try again."
resetAfter

Milliseconds the "Sent" state shows before resetting. 0 keeps it.

number2000

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

How is Grace Send accessible?

  • Countdown is a labelled group with the seconds in its name; status text in a polite live region and failures in role=alert
  • Escape cancels during the countdown; focus moves to Cancel when it starts and back to Send after
  • Pending button has aria-busy; icons are aria-hidden
  • Ring animation is dropped under reduced motion

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: Make the send idempotent on the server; the grace window is client-side only.

  • The delay lives in the open tab; closing the tab or a crash during the window cancels nothing on the server because nothing has been sent
  • Not undo: once onSend runs, the action is out
  • Does not de-duplicate sends on the server

What expensive mistakes does Grace Send stop?

Helps catch a send before second thoughts

Also known as

undo send · unsend · send delay · gmail undo send · chat · whatsapp · compose · send button

Field type

What dependencies does Grace Send require?

Grace Send facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameGrace Send
Registry identifier@bollard/grace-send
Install commandnpx shadcn@latest add @bollard/grace-send
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 Grace Send

How does Grace Send protect destructive mutations?

Grace Send prevents helps catch a send before second thoughts. Enforces deliberate friction against Send pressed too early or by mistake, Leaving the page during the countdown (beforeunload warning), Held Enter auto-repeating the press, Failed send surfaced with an alert. Limitation: authorize grace-send mutations on the server.

How do I install grace-send with shadcn?

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

What props customize Grace Send?

Grace Send accepts `onSend`, `onCancel`, `delay`, `children`, `disabled`. Configures undo send, unsend, send delay behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of grace-send?

The delay lives in the open tab; closing the tab or a crash during the window cancels nothing on the server because nothing has been sent. Not undo: once onSend runs, the action is out. Does not de-duplicate sends on the server Server requirement: Make the send idempotent on the server; the grace window is client-side only.

How does Grace Send meet accessibility guidelines?

Countdown is a labelled group with the seconds in its name; status text in a polite live region and failures in role=alert. Escape cancels during the countdown; focus moves to Cancel when it starts and back to Send after. Pending button has aria-busy; icons are aria-hidden. Ring animation is dropped under reduced motion. Minimizes errors: sent message to wrong person, undo send email.

Which components pair with Grace Send?