Passport Validity Check

Checks a passport against the destination's validity rule and names the date it must last until, so a trip isn't booked that the passport can't make.

StopsPassport expires before trip allows

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/passport-validity-check.json

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

Usage

passport-validity-check-usage.tsx
import { PassportValidityCheck, type PassportDetails, type Trip } from "@/components/ui/passport-validity-check"

<PassportValidityCheck destination={place} trip={trip} onTripChange={setTrip} value={passport} onValueChange={setPassport} />

What it catches

  • Validity shorter than the destination needs, from arrival or departure
  • Schengen: issued more than 10 years before arrival
  • Not enough blank or facing pages
  • Latest return date that would still pass

Props

PassportValidityCheck props
PropTypeDefault
trip* (required)

The trip: the day you arrive and the day you leave the destination.

Trip—
destination* (required)

Key into `rules`, e.g. "schengen".

string—
rules

Destination rules. Defaults to a small, sourced starter set.

Record<string, PassportRule>PASSPORT_RULES
value

Controlled passport details.

PassportDetails—
defaultValue

Initial passport details when uncontrolled.

PassportDetails{}
onValueChange

Called when the traveller edits the passport details.

(value: PassportDetails) => void—
onTripChange

Offers "Come back by {date}" when an earlier return would make the passport pass.

(trip: Trip) => void—
locale

Locale for dates.

string"en-IN"
delay

Pause in ms before the verdict is announced to screen readers after an edit.

number700
messages

Any visible string; `verdict` and `checks` may be partial.

Partial<Omit<PassportValidityMessages, "verdict" | "checks">> & { verdict?: Partial<PassportValidityMessages["verdict"]>; checks?: Partia…—

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

Accessibility

  • Section labelled by its heading
  • Expiry, issue date and pages inputs have visible labels
  • Icons are aria-hidden

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

Limitations

  • Built-in rules cover a few destinations and can change; airlines may apply stricter rules
  • Doesn't check visas or transit rules
  • Informational; check the official source

Rules

Rules last verified:

Informational; check the official source. Only the Singapore rule was confirmed this round. EUR-Lex blocked automated fetches, so the Schengen 3-month/10-year rule and the South Africa rule (dha.gov.za) were not re-verified. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What it stops

Passport expires before trip allows

Also known as

passport · passport expiry · visa · schengen · flight booking · travel docs · 6 month rule · traveller details

Dependencies

Pairs well with