Attachment Nudge

Attachment Nudge is a copy-paste React component that stops "see attached" sent without attachment 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/attachment-nudge
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

Stops"See attached" sent without attachment

Was this component page useful?

How do I install Attachment Nudge?

pnpm dlx shadcn@latest add @bollard/attachment-nudge

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

How do I use Attachment Nudge in React?

attachment-nudge-usage.tsx
import { AttachmentNudge, type Attachment } from "@/components/ui/attachment-nudge"

<AttachmentNudge
  label="Email body"
  value={message}
  onValueChange={setMessage}
  attachments={attachments}
  onAttach={attach}
  onRemoveAttachment={(id) => setAttachments((current) => current.filter((file) => file.id !== id))}
  onSend={() => {
    setSent(attachments.length ? `Sent with ${attachments.length} attachment(s).` : "Sent without attachments.")
    setAttachments([])
  }}
/>

What input mistakes does Attachment Nudge catch?

  • Attachment phrases ("see attached", "PFA", "attach kar diya") with no file attached
  • Phrases you add through extraPhrases
  • Skips quoted reply lines, negated or future mentions and messages with a Drive, Dropbox or OneDrive link

What props does Attachment Nudge accept?

AttachmentNudge props
PropTypeDefault
value

The message text (controlled).

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called on every edit.

(value: string) => void—
attachments* (required)

Files currently attached to the message.

Attachment[]—
onAttach* (required)

Open your file picker. Called from the Attach buttons.

() => void—
onRemoveAttachment

Remove one attachment. Hides the remove buttons when omitted.

(id: string) => void—
onSend* (required)

Send the message. Runs immediately unless an attachment seems to be missing.

(value: string) => void—
extraPhrases

Extra trigger phrases for your domain, e.g. /\binvoice\b/i.

RegExp[]—
label

Accessible label for the textarea.

string"Message"
placeholder

Placeholder text for the message box.

string"Write a message…"
promptLabel

Question in the send prompt; the matched phrase is shown before it.

string"Send without it?"
hintLabel

Hint while typing, after the matched phrase: “PFA” but nothing is attached.

string"but nothing is attached"
attachLabel

Attach button text in the prompt.

string"Attach"
sendAnywayLabel

Text of the button that sends without a file.

string"Send anyway"
sendLabel

Send button text.

string"Send"

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

How is Attachment Nudge accessible?

  • Textarea is labelled (aria-label) and Ctrl/Cmd+Enter sends, exposed via aria-keyshortcuts
  • The prompt is a role="group" labelled by its text; focus moves to Attach when it appears and Escape returns to the textarea
  • Remove buttons on attachments have aria-labels naming the file
  • A polite live region announces changes

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

What are the limitations and server boundaries?

  • Phrase matching only; other wordings and other languages are missed
  • It cannot check that the attached file is the right one

What expensive mistakes does Attachment Nudge stop?

"See attached" sent without attachment

Also known as

attachment reminder · forgot attachment · pfa · please find attached · hinglish · compose email · gmail · chat

Field type

What dependencies does Attachment Nudge require?

Attachment Nudge facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameAttachment Nudge
Registry identifier@bollard/attachment-nudge
Install commandnpx shadcn@latest add @bollard/attachment-nudge
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 Attachment Nudge

How does Attachment Nudge validate Indian financial identifiers?

Attachment Nudge stops "See attached" sent without attachment. Complies with national standards for Attachment phrases ("see attached", "PFA", "attach kar diya") with no file attached, Phrases you add through extraPhrases, Skips quoted reply lines, negated or future mentions and messages with a Drive, Dropbox or OneDrive link. Limitation: verify attachment-nudge with issuer gateway.

How do I install attachment-nudge with shadcn?

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

What props customize Attachment Nudge?

Attachment Nudge accepts `value`, `defaultValue`, `onValueChange`, `attachments`, `onAttach`. Configures attachment reminder, forgot attachment, pfa behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of attachment-nudge?

Phrase matching only; other wordings and other languages are missed. It cannot check that the attached file is the right one Server requirement: backend verification for attachment-nudge.

How does Attachment Nudge meet accessibility guidelines?

Textarea is labelled (aria-label) and Ctrl/Cmd+Enter sends, exposed via aria-keyshortcuts. The prompt is a role="group" labelled by its text; focus moves to Attach when it appears and Escape returns to the textarea. Remove buttons on attachments have aria-labels naming the file. A polite live region announces changes. Minimizes errors: forgot attachment, pfa without file.

Which components pair with Attachment Nudge?