Passenger Name Input

Passenger Name Input is a copy-paste React component that stops boarding denied over a ticket 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/passenger-name-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

StopsBoarding denied over a ticket name

Was this component page useful?

How do I install Passenger Name Input?

pnpm dlx shadcn@latest add @bollard/passenger-name-input

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

How do I use Passenger Name Input in React?

passenger-name-input-usage.tsx
import { PassengerNameInput, type IdName, type PassengerName } from "@/components/ui/passenger-name-input"

<PassengerNameInput key={pick.id} value={name} onValueChange={setName} idName={pick.idName} singleNameFormat={pick.format} messages={{ legend: "Adult 1 · as on passport" }} />

What input mistakes does Passenger Name Input catch?

  • Given name and surname swapped
  • Middle name on the ID missing from the booking
  • Title, suffix or nickname typed into a name field
  • Single-name passengers, ticketed as repeat (JONES/JONES) or FNU
  • Accents or characters the ticket can't print, and names over maxLength

What props does Passenger Name Input accept?

PassengerNameInput props
PropTypeDefault
value

Controlled name.

PassengerName—
defaultValue

Initial name when uncontrolled.

PassengerName{ title: "", given: "", surname: "" }
onValueChange

Called with the whole name whenever any part changes. Nothing is rewritten without a tap.

(value: PassengerName) => void—
idName

The name exactly as on the passport or ID, when you have it (saved profile, scanned MRZ). Turns guesses into exact fixes.

IdName | null—
singleNameFormat

How a single-name passenger is ticketed: "repeat" (IndiGo: LAKSHMI/LAKSHMI) or "fnu" (IATA AIRIMP, needed for US and Canada: LAKSHMI/FNU).

"repeat" | "fnu""repeat"
middleNames

"optional" stops asking for middle names that are on the ID (Air India domestic, for example). Default "required".

"required" | "optional""required"
maxLength

Longest printed name the airline takes, title included.

number59
titles

Titles offered in the title box.

string[]PASSENGER_TITLES
onIssuesChange

Called whenever the list of open issues changes, to gate the Continue button.

(issues: PassengerIssue[]) => void—
delay

Pause in ms after typing before issues appear. Leaving a field shows them at once.

number600
messages

Any visible string; `issues` and `fixes` may be partial.

Partial<Omit<PassengerNameMessages, "issues" | "fixes">> & { issues?: Partial<PassengerNameMessages["issues"]>; fixes?: PassengerNameMess…—

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

How is Passenger Name Input accessible?

  • Title and name inputs have visible labels and are described by the hint and issues
  • Fix buttons are disabled while the result is stale
  • Focus moves to the next fix or the given-name field after a fix

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

What are the limitations and server boundaries?

  • Airline rules differ; defaults follow the airlines named in the code and should be checked for yours
  • Comparison with the ID only works when you pass idName
  • Doesn't change a booking already made

What validation rules apply to Passenger Name Input?

Rules not yet verified against an official source.

Not verified this round: airline single-name conventions (IndiGo, Air India, IATA AIRIMP FNU) and length limits come from the code's comments. Check with the airline. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Passenger Name Input stop?

Boarding denied over a ticket name

Also known as

passenger details · flight booking · irctc · train ticket · name as on id · traveller name · pnr · airline

Field type

What dependencies does Passenger Name Input require?

Passenger Name Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePassenger Name Input
Registry identifier@bollard/passenger-name-input
Install commandnpx shadcn@latest add @bollard/passenger-name-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 Passenger Name Input

How does Passenger Name Input prevent financial transaction errors?

Passenger Name Input prevents boarding denied over a ticket name. Blocks Given name and surname swapped, Middle name on the ID missing from the booking, Title, suffix or nickname typed into a name field, Single-name passengers, ticketed as repeat (JONES/JONES) or FNU, Accents or characters the ticket can't print, and names over maxLength before processing. Limitation: apply idempotency keys for passenger-name-input.

How do I install passenger-name-input with shadcn?

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

What props customize Passenger Name Input?

Passenger Name Input accepts `value`, `defaultValue`, `onValueChange`, `idName`, `singleNameFormat`. Configures passenger details, flight booking, irctc behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of passenger-name-input?

Airline rules differ; defaults follow the airlines named in the code and should be checked for yours. Comparison with the ID only works when you pass idName. Doesn't change a booking already made Server requirement: backend verification for passenger-name-input.

How does Passenger Name Input meet accessibility guidelines?

Title and name inputs have visible labels and are described by the hint and issues. Fix buttons are disabled while the result is stale. Focus moves to the next fix or the given-name field after a fix. Minimizes errors: passenger name mismatch id, name change fee flight.

Which components pair with Passenger Name Input?