Forward Guard

Forward Guard is a copy-paste React component that stops forwarded internal notes to a client 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/forward-guard
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

StopsForwarded internal notes to a client

Was this component page useful?

How do I install Forward Guard?

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

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

How do I use Forward Guard in React?

forward-guard-usage.tsx
import { ForwardGuard, type ThreadMessage } from "@/components/ui/forward-guard"

<ForwardGuard
  messages={thread}
  recipients={["dana@northwind.io"]}
  self={me.email}
  onForward={(s) => new Promise<void>((done) => setTimeout(() => (setSent(`Forwarded ${s.messageIds.length} messages, ${s.attachmentIds.length} files.`), done()), 600))}
/>

What input mistakes does Forward Guard catch?

  • Earlier messages the new recipients haven't seen
  • Internal notes, trimmed by default
  • Attachments in the thread
  • Other people's email addresses, with an option to hide them

What props does Forward Guard accept?

ForwardGuard props
PropTypeDefault
messages* (required)

The thread, oldest first.

ThreadMessage[]—
recipients* (required)

Addresses the thread is being forwarded or shared to.

string[]—
self

Your own address, never counted as exposed.

string—
value

What goes along (controlled).

ForwardSelection—
defaultValue

Starting selection. Defaults to everything except internal notes.

ForwardSelection—
onValueChange

Called with the items chosen to include.

(value: ForwardSelection) => void—
onForward

Sends the forward. Return a promise to show a pending state.

(selection: ForwardSelection) => void | Promise<void>—
headline

Templates: `{who}` is the new recipients.

string"{who} will see for the first time:"
forwardLabel

Forward button text.

string"Forward"
hideAddressesLabel

Label for hiding other people's addresses.

string"Hide other people's addresses"
labels

Override any other string, including the plural forms.

Partial<typeof FORWARD_GUARD_LABELS>—

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

How is Forward Guard accessible?

  • Each item has a labelled checkbox (aria-label names it)
  • The summary is aria-live="polite"
  • Forward sets aria-busy while sending

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

What are the limitations and server boundaries?

  • Uses the thread and recipient data you pass
  • Forwarding runs your onForward; the mail system sends what it receives

What expensive mistakes does Forward Guard stop?

Forwarded internal notes to a client

Also known as

forward · email thread · internal notes · share thread · attachments · helpdesk · fwd · support ticket

Field type

What dependencies does Forward Guard require?

Forward Guard facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameForward Guard
Registry identifier@bollard/forward-guard
Install commandnpx shadcn@latest add @bollard/forward-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
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 Forward Guard

What form validation mistake does Forward Guard catch?

Forward Guard prevents forwarded internal notes to a client. Lists what new recipients will see for the first time when a thread is forwarded, so internal notes and addresses aren't overshared. Catches: Earlier messages the new recipients haven't seen, Internal notes, trimmed by default, Attachments in the thread, Other people's email addresses, with an option to hide them. Limitation: validate forward-guard schemas on backend.

How do I install forward-guard with shadcn?

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

What props customize Forward Guard?

Forward Guard accepts `messages`, `recipients`, `self`, `value`, `defaultValue`. Configures forward, email thread, internal notes behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of forward-guard?

Uses the thread and recipient data you pass. Forwarding runs your onForward; the mail system sends what it receives Server requirement: backend verification for forward-guard.

How does Forward Guard meet accessibility guidelines?

Each item has a labelled checkbox (aria-label names it). The summary is aria-live="polite". Forward sets aria-busy while sending. Minimizes errors: forwarded whole thread, internal notes sent to customer.

Which components pair with Forward Guard?