Recipient Check

Recipient Check is a copy-paste React component that stops email sent to the wrong address 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/recipient-check
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

StopsEmail sent to the wrong address

Was this component page useful?

How do I install Recipient Check?

pnpm dlx shadcn@latest add @bollard/recipient-check

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

How do I use Recipient Check in React?

recipient-check-usage.tsx
import { RecipientCheck, type Recipient } from "@/components/ui/recipient-check"

<RecipientCheck
  label="To"
  value={recipients}
  onValueChange={setRecipients}
  internalDomains={["acme.com"]}
  contacts={contacts}
  warnAt={25}
/>

What input mistakes does Recipient Check catch?

  • Recipients outside your internal domains
  • Typo'd consumer domains (gmial.com → gmail.com) with a one-tap fix
  • Duplicate addresses
  • A known contact's name paired with a different address
  • More recipients than warnAt, with a one-tap remove-externals

What props does Recipient Check accept?

RecipientCheck props
PropTypeDefault
value

Recipients (controlled).

Recipient[]—
defaultValue

Starting recipients when uncontrolled.

Recipient[][]
onValueChange

Called with the full recipient list after every change.

(value: Recipient[]) => void—
internalDomains* (required)

Your organisation's domains. Everyone else is marked external.

string[]—
contacts

Known people, used to catch a name paired with the wrong address.

Required<Recipient>[][]
warnAt

Warn when the message goes to more people than this.

number25
label

Field label, e.g. "To" or "Cc".

string"To"
placeholder

Placeholder while the field is empty.

string"name@company.com"
messages

Override any user-visible string (see `RECIPIENT_MESSAGES`).

Partial<RecipientMessages>—
inputRef

Ref to the text input, e.g. to focus it.

React.Ref<HTMLInputElement>—

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

How is Recipient Check accessible?

  • Visible <label> tied to the input; aria-invalid when any recipient has an error
  • Enter, comma, semicolon or Tab commits an address; Backspace on an empty field arms then removes the last chip
  • Chip issues are spoken through sr-only text; each remove button has an aria-label
  • Warnings and fixes render in a polite live region; icons are aria-hidden
  • Undo after a bulk remove

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

What are the limitations and server boundaries?

  • Typo detection uses edit distance against a built-in list and your domains; unusual domains can be missed or wrongly flagged
  • Does not check that a mailbox exists
  • Name/address mismatch only works for people in contacts

What expensive mistakes does Recipient Check stop?

Email sent to the wrong address

Also known as

recipients · to field · email · autocomplete · external · typo domain · gmail · compose

Field type

What dependencies does Recipient Check require?

Recipient Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameRecipient Check
Registry identifier@bollard/recipient-check
Install commandnpx shadcn@latest add @bollard/recipient-check
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 Recipient Check

What form validation mistake does Recipient Check catch?

Recipient Check prevents email sent to the wrong address. Reduces misaddressed email by flagging external recipients, lookalike or typo'd domains, duplicates and names paired with the wrong address. Catches: Recipients outside your internal domains, Typo'd consumer domains (gmial.com → gmail.com) with a one-tap fix, Duplicate addresses, A known contact's name paired with a different address, More recipients than warnAt, with a one-tap remove-externals. Limitation: validate recipient-check schemas on backend.

How do I install recipient-check with shadcn?

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

What props customize Recipient Check?

Recipient Check accepts `value`, `defaultValue`, `onValueChange`, `internalDomains`, `contacts`. Configures recipients, to field, email behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of recipient-check?

Typo detection uses edit distance against a built-in list and your domains; unusual domains can be missed or wrongly flagged. Does not check that a mailbox exists. Name/address mismatch only works for people in contacts Server requirement: backend verification for recipient-check.

How does Recipient Check meet accessibility guidelines?

Visible <label> tied to the input; aria-invalid when any recipient has an error. Enter, comma, semicolon or Tab commits an address; Backspace on an empty field arms then removes the last chip. Chip issues are spoken through sr-only text; each remove button has an aria-label. Warnings and fixes render in a polite live region; icons are aria-hidden. Undo after a bulk remove. Minimizes errors: typo in email domain, sent to wrong recipient.

Which components pair with Recipient Check?