Merge Field Check

Merge Field Check is a copy-paste React component that stops email went out as hi {{first_name}} 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/merge-field-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 went out as Hi {{first_name}}

Was this component page useful?

How do I install Merge Field Check?

pnpm dlx shadcn@latest add @bollard/merge-field-check

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

How do I use Merge Field Check in React?

merge-field-check-usage.tsx
import { MergeFieldCheck, type MergeRecipient } from "@/components/ui/merge-field-check"

return <MergeFieldCheck value={template} onValueChange={setTemplate} recipients={recipients} />

What input mistakes does Merge Field Check catch?

  • Unknown fields, with typo suggestions (frist_name → first_name)
  • Broken braces such as {first_name}} or {{first_name,
  • Recipients with an empty or whitespace-only value
  • Missing fallbacks: adds {{field | default: "there"}}

What props does Merge Field Check accept?

MergeFieldCheck props
PropTypeDefault
value

The template (controlled), using `{{field}}` and `{{field | default: "there"}}`.

string—
defaultValue

Starting template when uncontrolled.

string""
onValueChange

Called with the template after every edit or one-tap fix.

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

The real audience, one row per recipient.

MergeRecipient[]—
fields

Fields that exist. Defaults to every key found on the recipients.

string[]—
fallbacks

Suggested fallback per field. Name-like fields default to "there".

Record<string, string>{}
getRecipientLabel

How a recipient is named in the stepper. Defaults to email, phone or name.

(recipient: MergeRecipient, index: number) => string(r, i) => r.email ?? r.phone ?? r.name ?? `Recipient ${i …
label

Visible label.

string"Message"
previewLabel

Label above the per-recipient preview.

string"Preview as"
nextProblemLabel

Button text to step to the next recipient with a gap.

string"Next problem"
cleanText

Shown when nothing needs fixing. `{count}` is the audience size.

string"Every field fills in for all {count}."

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

How is Merge Field Check accessible?

  • Visible label; textarea has aria-invalid for template errors and is described by the issues list
  • Issues list is a polite live region
  • Fixes are buttons; focus returns to the textarea

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

What are the limitations and server boundaries?

  • Understands {{field}} and {{field | default: "…"}} only, not full Liquid or Handlebars
  • Checks the recipients you pass, not your whole list

What expensive mistakes does Merge Field Check stop?

Email went out as Hi {{first_name}}

Also known as

mail merge · merge tags · template · personalization · email campaign · sms template · handlebars · first name

Field type

What dependencies does Merge Field Check require?

Merge Field Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameMerge Field Check
Registry identifier@bollard/merge-field-check
Install commandnpx shadcn@latest add @bollard/merge-field-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 Merge Field Check

What form validation mistake does Merge Field Check catch?

Merge Field Check prevents email went out as Hi {{first_name}}. Renders a mail-merge template for each real recipient, so nothing goes out as "Hi ," or "{{frist_name}}". Catches: Unknown fields, with typo suggestions (frist_name → first_name), Broken braces such as {first_name}} or {{first_name,, Recipients with an empty or whitespace-only value, Missing fallbacks: adds {{field | default: "there"}}. Limitation: validate merge-field-check schemas on backend.

How do I install merge-field-check with shadcn?

Run `npx shadcn@latest add @bollard/merge-field-check`. Sources added: registry/default/merge-field-check/merge-field-check.tsx, registry/default/merge-field-check/merge-fields.ts. Package requirements: lucide-react.

What props customize Merge Field Check?

Merge Field Check accepts `value`, `defaultValue`, `onValueChange`, `recipients`, `fields`. Configures mail merge, merge tags, template behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of merge-field-check?

Understands {{field}} and {{field | default: "…"}} only, not full Liquid or Handlebars. Checks the recipients you pass, not your whole list Server requirement: backend verification for merge-field-check.

How does Merge Field Check meet accessibility guidelines?

Visible label; textarea has aria-invalid for template errors and is described by the issues list. Issues list is a polite live region. Fixes are buttons; focus returns to the textarea. Minimizes errors: hi comma blank name, merge tag not replaced.

Which components pair with Merge Field Check?