Seat Gap Check

Catches group seat picks that split the party, leave a single empty seat or seat a child away from every adult.

StopsGroup split across row at booking

Installation

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

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

Usage

seat-gap-check-usage.tsx
import { parseSeatMap, SeatGapCheck, type SeatIssue } from "@/components/ui/seat-gap-check"

<SeatGapCheck rows={ROWS} travellers={FAMILY} value={seats} onValueChange={setSeats} onIssuesChange={setIssues} />

What it catches

  • Party split across a row or aisle
  • A single orphan seat left between taken seats (orphanRule)
  • A child with no adult beside them
  • One-tap move to the nearest contiguous block, children beside adults

Props

SeatGapCheck props
PropTypeDefault
rows* (required)

The seat map, front row first. `parseSeatMap` builds one from text.

SeatRow[]—
travellers* (required)

Who needs a seat. Seats are given out in this order.

Traveller[]—
value

Controlled seats, one per traveller in the same order ("" for none yet).

string[]—
defaultValue

Initial seats when uncontrolled.

string[][]
onValueChange

Called with the seat for each traveller.

(seats: string[]) => void—
orphanRule

Single empty seats: "warn" (default), "block" (the venue refuses them; say so) or "off" (flights, buses).

"warn" | "block" | "off""warn"
onIssuesChange

Called whenever the open issues change, to gate checkout.

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

Pause in ms before the issue count is announced to screen readers.

number500
messages

Any visible string; `issues` may be partial. Set `front` to "" to hide the screen bar.

Partial<Omit<SeatGapMessages, "issues">> & { issues?: Partial<SeatGapMessages["issues"]> }—

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

Accessibility

  • Seat map is a role=grid with rowheaders; one tab stop with arrow-key, Home and End navigation
  • Each seat button has an aria-label with its status and aria-pressed when chosen
  • Issue icons are aria-hidden with text alongside

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

Limitations

  • Venue rules differ; set orphanRule to match yours
  • Works on the seat map you pass; prices and accessibility seats are not considered

What it stops

Group split across row at booking

Also known as

seat selection · seat map · movie tickets · bookmyshow · cinema seats · flight seats · seats together · bus seats

Dependencies

Pairs well with