Forward Guard

Lists what new recipients will see for the first time when a thread is forwarded, so internal notes and addresses aren't overshared.

StopsForwarded internal notes to a client

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/forward-guard.json

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

Usage

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 it 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

Props

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.

Accessibility

  • 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.

Limitations

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

What it stops

Forwarded internal notes to a client

Also known as

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

Field type

Dependencies

Pairs well with