Passport Validity Check

Passport Validity Check is a copy-paste React component that stops passport expires before trip allows 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/passport-validity-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

StopsPassport expires before trip allows

Was this component page useful?

How do I install Passport Validity Check?

pnpm dlx shadcn@latest add @bollard/passport-validity-check

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

How do I use Passport Validity Check in React?

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 input mistakes does Passport Validity Check catch?

  • 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

What props does Passport Validity Check accept?

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.

How is Passport Validity Check accessible?

  • 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.

What are the limitations and server boundaries?

  • 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

What validation rules apply to Passport Validity Check?

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 expensive mistakes does Passport Validity Check stop?

Passport expires before trip allows

Also known as

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

What dependencies does Passport Validity Check require?

Passport Validity Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePassport Validity Check
Registry identifier@bollard/passport-validity-check
Install commandnpx shadcn@latest add @bollard/passport-validity-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 Passport Validity Check

How does Passport Validity Check prevent financial transaction errors?

Passport Validity Check prevents passport expires before trip allows. Blocks 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 before processing. Limitation: apply idempotency keys for passport-validity-check.

How do I install passport-validity-check with shadcn?

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

What props customize Passport Validity Check?

Passport Validity Check accepts `trip`, `destination`, `rules`, `value`, `defaultValue`. Configures passport, passport expiry, visa behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of passport-validity-check?

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 Server requirement: backend verification for passport-validity-check.

How does Passport Validity Check meet accessibility guidelines?

Section labelled by its heading. Expiry, issue date and pages inputs have visible labels. Icons are aria-hidden. Minimizes errors: passport 6 month rule, schengen passport validity.

Which components pair with Passport Validity Check?