Trip Date Chain

Trip Date Chain is a copy-paste React component that stops hotel booked for the wrong night 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/trip-date-chain
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 4 extra npm packages
  • A11y guidance in docs

StopsHotel booked for the wrong night

Was this component page useful?

How do I install Trip Date Chain?

pnpm dlx shadcn@latest add @bollard/trip-date-chain

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

How do I use Trip Date Chain in React?

trip-date-chain-usage.tsx
import { TripDateChain, type TripLeg, type TripStay } from "@/components/ui/trip-date-chain"

return <TripDateChain legs={LEGS} defaultValue={STAYS} locale="en-GB" />

What input mistakes does Trip Date Chain catch?

  • Room booked from the date of a small-hours arrival (needs the night before)
  • Nights paid before a +1-day arrival
  • Gap nights with no stay
  • Overlapping stays (double-booked nights)
  • Room kept past a small-hours departure
  • Tight connections below minConnectionMinutes

What props does Trip Date Chain accept?

TripDateChain props
PropTypeDefault
legs* (required)

Flights and trains, with local times as printed.

TripLeg[]—
value

Controlled stays.

TripStay[]—
defaultValue

Initial stays when uncontrolled.

TripStay[][]
onValueChange

Called with the stays after a fix or undo.

(stays: TripStay[]) => void—
earlyHours

Times before this hour belong to the previous night (landing 00:50 needs the room from the night before). Default 6.

number6
minConnectionMinutes

With zones on both ends, a gap shorter than this between landing and the next take-off is flagged. Default 60.

number60
locale

12- or 24-hour clock follows the locale.

string—
messages

Override any visible string.

Partial<TripDateChainMessages>—

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

How is Trip Date Chain accessible?

  • Visual strip is aria-hidden; every finding is also text
  • Fix and Undo are labelled buttons; outcome via role=status
  • Focus moves to the next fix after one is applied
  • Animations respect reduced motion

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

What are the limitations and server boundaries?

  • Times are local wall-clock times as printed; add IANA zones for real durations
  • Reads only the legs and stays you pass
  • earlyHours defines "small hours" (configurable)

What expensive mistakes does Trip Date Chain stop?

Hotel booked for the wrong night

Also known as

itinerary · hotel booking · check-in date · check-out date · red-eye · overnight flight · +1 day arrival · travel planner

Field type

What dependencies does Trip Date Chain require?

Trip Date Chain facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameTrip Date Chain
Registry identifier@bollard/trip-date-chain
Install commandnpx shadcn@latest add @bollard/trip-date-chain
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, motion, date-fns, @date-fns/tz
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 Trip Date Chain

How does Trip Date Chain prevent financial transaction errors?

Trip Date Chain prevents hotel booked for the wrong night. Blocks Room booked from the date of a small-hours arrival (needs the night before), Nights paid before a +1-day arrival, Gap nights with no stay, Overlapping stays (double-booked nights), Room kept past a small-hours departure, Tight connections below minConnectionMinutes before processing. Limitation: apply idempotency keys for trip-date-chain.

How do I install trip-date-chain with shadcn?

Run `npx shadcn@latest add @bollard/trip-date-chain`. Sources added: registry/default/trip-date-chain/chain.ts, registry/default/trip-date-chain/trip-date-chain.tsx. Package requirements: lucide-react, motion, date-fns, @date-fns/tz.

What props customize Trip Date Chain?

Trip Date Chain accepts `legs`, `value`, `defaultValue`, `onValueChange`, `earlyHours`. Configures itinerary, hotel booking, check-in date behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of trip-date-chain?

Times are local wall-clock times as printed; add IANA zones for real durations. Reads only the legs and stays you pass. earlyHours defines "small hours" (configurable) Server requirement: backend verification for trip-date-chain.

How does Trip Date Chain meet accessibility guidelines?

Visual strip is aria-hidden; every finding is also text. Fix and Undo are labelled buttons; outcome via role=status. Focus moves to the next fix after one is applied. Animations respect reduced motion. Minimizes errors: landed after midnight no hotel room, hotel booked a day late after overnight flight.

Which components pair with Trip Date Chain?