MRZ Paste Input

MRZ Paste Input is a copy-paste React component that stops helps catch misread passport details before booking 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/mrz-paste-input
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

StopsHelps catch misread passport details before booking

Was this component page useful?

How do I install MRZ Paste Input?

pnpm dlx shadcn@latest add @bollard/mrz-paste-input

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

How do I use MRZ Paste Input in React?

mrz-paste-input-usage.tsx
import { MrzPasteInput } from "@/components/ui/mrz-paste-input"

<MrzPasteInput value={text} onValueChange={setText} today={TODAY} />

What input mistakes does MRZ Paste Input catch?

  • Wrong check digits for number, birth date, expiry, personal number and composite
  • OCR slips such as O for 0 and K for <
  • Swapped lines, CRLF and stray spaces
  • Likeliest fix for a wrong digit, cross-checked against the composite
  • Expired or soon-expiring passport

What props does MRZ Paste Input accept?

MrzPasteInput props
PropTypeDefault
value

Controlled MRZ text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the text on every edit or fix.

(value: string) => void—
onParse

Called when the parse result changes; `result.valid` is true once every check passes.

(result: MrzResult) => void—
today

"Today", for the expiry check and the birth-year century. Pass it for deterministic rendering.

Date—
locale

Locale for dates.

string"en-IN"
delay

Pause in ms before problems are read out after typing.

number700
messages

Any visible string; `fields` and `sexes` may be partial.

Partial<Omit<MrzMessages, "fields" | "sexes">> & { fields?: Partial<MrzMessages["fields"]>; sexes?: Partial<MrzMessages["sexes"]> }—

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

How is MRZ Paste Input accessible?

  • Visible label; textarea has aria-invalid when invalid and is described by the result
  • Each check has an icon with role=img and an aria-label (checked, pending, failed)
  • Focus moves to the first fix after parsing

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

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Re-validate the MRZ and verify identity through your KYC provider on the server; don't log full MRZ lines.

  • Passports (TD3) only, not ID cards (TD1/TD2) or visas
  • Valid check digits don't prove the passport is genuine
  • Names in the MRZ are transliterated and may be truncated

What validation rules apply to MRZ Paste Input?

Rules last verified:

Informational. Confirmed the 7-3-1 weighting and the composite over positions 1–10, 14–20 and 22–43. The soon-expiring threshold is a product choice, not ICAO. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does MRZ Paste Input stop?

Helps catch misread passport details before booking

Also known as

passport · mrz · icao 9303 · td3 · passport scan · kyc · flight booking · visa form

What dependencies does MRZ Paste Input require?

MRZ Paste Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameMRZ Paste Input
Registry identifier@bollard/mrz-paste-input
Install commandnpx shadcn@latest add @bollard/mrz-paste-input
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 MRZ Paste Input

How does MRZ Paste Input prevent financial transaction errors?

MRZ Paste Input prevents helps catch misread passport details before booking. Blocks Wrong check digits for number, birth date, expiry, personal number and composite, OCR slips such as O for 0 and K for <, Swapped lines, CRLF and stray spaces, Likeliest fix for a wrong digit, cross-checked against the composite, Expired or soon-expiring passport before processing. Limitation: apply idempotency keys for mrz-paste-input.

How do I install mrz-paste-input with shadcn?

Run `npx shadcn@latest add @bollard/mrz-paste-input`. Sources added: registry/default/mrz-paste-input/mrz-paste-input.tsx, registry/default/mrz-paste-input/mrz.ts. Package requirements: lucide-react.

What props customize MRZ Paste Input?

MRZ Paste Input accepts `value`, `defaultValue`, `onValueChange`, `onParse`, `today`. Configures passport, mrz, icao 9303 behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of mrz-paste-input?

Passports (TD3) only, not ID cards (TD1/TD2) or visas. Valid check digits don't prove the passport is genuine. Names in the MRZ are transliterated and may be truncated Server requirement: Re-validate the MRZ and verify identity through your KYC provider on the server; don't log full MRZ lines.

How does MRZ Paste Input meet accessibility guidelines?

Visible label; textarea has aria-invalid when invalid and is described by the result. Each check has an icon with role=img and an aria-label (checked, pending, failed). Focus moves to the first fix after parsing. Minimizes errors: passport mrz check digit, ocr passport wrong number.

Which components pair with MRZ Paste Input?