Seat Map
Pick seats for a show. Drag along a row to take several, and it points out any single seat you'd leave stranded.
Installation
npx shadcn@latest add @kokonutui/seat-map
Props
| Prop |
Type |
Default |
Description |
title? |
string |
"Dune: Part Three" |
|
subtitle? |
string |
"Today · 19:30 · Screen 4" |
|
tiers? |
SeatTier[] |
built-in |
|
blocks? |
number[] |
[3, 6, 3] |
Seats per block, left to right, with an aisle between blocks. |
taken? |
string[] |
built-in |
Seat ids already sold, like "D7". |
accessible? |
string[] |
["A1", "A12"] |
Seats with wheelchair space. |
defaultSelected? |
string[] |
[] |
|
maxSeats? |
number |
8 |
Most seats one booking can hold. |
currency? |
string |
"$" |
|
onChange? |
(seats: string[]) => void |
|
|
onContinue? |
(seats: string[], total: number) => void |
|
|
className? |
string |
|
Extra classes for the root element. |
SeatTier
| Field |
Type |
Description |
name |
string |
|
price |
number |
|
rows |
string[] |
Row letters in this tier, front to back. |
Source
// ... code omitted for clarity
The grid holds the pointer, not the seat, so the drag survives crossing from one seat to the next.
Clicks from a pointer are handled by the paint above; this is Enter and Space on a focused seat.
A free seat boxed in by the booking on one side and a sold seat, the booking or the aisle on the other is one nobody will buy.
Drag along a row to pick several.
The screen, curved toward the seats.