Bcc Guard

Bcc Guard is a copy-paste React component that stops recipients see each other's addresses 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/bcc-guard
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 3 extra npm packages
  • A11y guidance in docs

StopsRecipients see each other's addresses

Was this component page useful?

How do I install Bcc Guard?

pnpm dlx shadcn@latest add @bollard/bcc-guard

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

How do I use Bcc Guard in React?

bcc-guard-usage.tsx
import { BccGuard, type Recipients } from "@/components/ui/bcc-guard"

<BccGuard
  defaultValue={START}
  internalDomains={["soho-clinic.nhs.uk"]}
  from="news@soho-clinic.nhs.uk"
  subject={subject}
  onSend={async (v, mode) => {
    await new Promise((r) => setTimeout(r, 600))
    setSent(mode === "individually" ? `Queued ${list.length} separate emails, one per person.` : `Sent to ${v.to.length + v.cc.length + v.bcc.length} recipients.`)
  }}
/>

What input mistakes does Bcc Guard catch?

  • Recipients who can see each other's addresses on To or Cc
  • Addresses or display names that give away a person's name, and outside companies
  • Subjects or bodies with terms that make being on the list sensitive
  • Sending while addresses still show, with options to move them to Bcc or send one email each

What props does Bcc Guard accept?

BccGuard props
PropTypeDefault
value

Controlled recipients.

Recipients—
defaultValue

Initial recipients when uncontrolled.

Recipients—
onValueChange

Fires with the new recipients after a fix or an undo.

(value: Recipients) => void—
internalDomains

Your own organisation's domains; colleagues there may see each other.

string[]—
from

The sender's address. When every recipient moves to Bcc it fills the empty To line.

string—
subject

Subject and body, scanned for terms that make the list itself sensitive.

string—
body

Email body, scanned for sensitive terms.

string—
sensitiveTerms

Terms that make membership of the list sensitive. Replaces the default list; spread DEFAULT_SENSITIVE_TERMS to extend it.

string[]—
exposeAt

How many outside organisations seeing each other counts as exposed (default 3; 2 on a sensitive email).

number—
onSend

Sends the email. `individually` asks for one message per recipient. May return a Promise.

(value: Recipients, mode: "together" | "individually") => void | Promise<void>—
previewCount

Addresses shown in the preview before "+N more". Default 3.

number3
messages

Override any visible string.

Partial<Messages>—

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

How is Bcc Guard accessible?

  • The preview is labelled by its heading (aria-labelledby)
  • Focus moves to the next sensible action (Move to Bcc, then Send)
  • The second-press warning uses role="alert" and the Send button is described by it
  • Status is announced in a role="status" region; motion respects prefers-reduced-motion

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

What are the limitations and server boundaries?

  • Sensitive-term matching uses a word list (replaceable); other sensitive contexts are missed
  • Internal vs outside is decided only by the internalDomains you pass
  • It cannot stop replies-all or forwards after sending

What expensive mistakes does Bcc Guard stop?

Recipients see each other's addresses

Also known as

bcc · cc · to field · recipients · newsletter · mailing list · compose · mail merge

Field type

What dependencies does Bcc Guard require?

Bcc Guard facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameBcc Guard
Registry identifier@bollard/bcc-guard
Install commandnpx shadcn@latest add @bollard/bcc-guard
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, motion, @number-flow/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 Bcc Guard

What form validation mistake does Bcc Guard catch?

Bcc Guard prevents recipients see each other's addresses. Shows the To line as each recipient will see it, so a group email doesn't expose everyone's names and addresses to each other. Catches: Recipients who can see each other's addresses on To or Cc, Addresses or display names that give away a person's name, and outside companies, Subjects or bodies with terms that make being on the list sensitive, Sending while addresses still show, with options to move them to Bcc or send one email each. Limitation: validate bcc-guard schemas on backend.

How do I install bcc-guard with shadcn?

Run `npx shadcn@latest add @bollard/bcc-guard`. Sources added: registry/default/bcc-guard/bcc-guard.tsx, registry/default/bcc-guard/exposure.ts. Package requirements: lucide-react, motion, @number-flow/react.

What props customize Bcc Guard?

Bcc Guard accepts `value`, `defaultValue`, `onValueChange`, `internalDomains`, `from`. Configures bcc, cc, to field behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of bcc-guard?

Sensitive-term matching uses a word list (replaceable); other sensitive contexts are missed. Internal vs outside is decided only by the internalDomains you pass. It cannot stop replies-all or forwards after sending Server requirement: backend verification for bcc-guard.

How does Bcc Guard meet accessibility guidelines?

The preview is labelled by its heading (aria-labelledby). Focus moves to the next sensible action (Move to Bcc, then Send). The second-press warning uses role="alert" and the Send button is described by it. Status is announced in a role="status" region; motion respects prefers-reduced-motion. Minimizes errors: forgot to use bcc, group email exposed addresses.

Which components pair with Bcc Guard?