Seat & Group Bookings
Seat bookings enable event types with multiple attendees per time slot — yoga classes, workshops, group sessions.
Seat availability
Section titled “Seat availability”import { computeSeatAvailability, isGroupEvent } from "@thebookingkit/core";
// Check if an event type supports group bookingsisGroupEvent({ maxSeats: 20 }); // trueisGroupEvent({ maxSeats: 1 }); // false
// Compute remaining capacityconst availability = computeSeatAvailability({ maxSeats: 20, attendees: existingAttendees, // SeatAttendee[]});
// Returns: SeatAvailability// { totalSeats: 20, bookedSeats: 12, remainingSeats: 8, isFull: false }Reserving seats
Section titled “Reserving seats”import { canReserveSeat, validateSeatReservation, SeatError } from "@thebookingkit/core";
// Quick checkcanReserveSeat(availability, 3); // true if 3+ seats remain
// Full validation (throws SeatError if invalid)validateSeatReservation({ maxSeats: 20, currentAttendees: existingAttendees, requestedSeats: 3,});Group event summary
Section titled “Group event summary”import { computeGroupEventSummary, formatSeatCount } from "@thebookingkit/core";
const summary = computeGroupEventSummary({ maxSeats: 20, attendees: existingAttendees, slotStart: new Date("2026-03-10T14:00:00Z"), slotEnd: new Date("2026-03-10T15:00:00Z"),});
// Returns: GroupEventSummary// { totalSeats, bookedSeats, remainingSeats, attendeeList, isFull }
formatSeatCount(8, 20); // "8 / 20 seats booked"UI component
Section titled “UI component”import { SeatsPicker } from "./components/seats-picker";
<SeatsPicker maxSeats={availability.remainingSeats} selectedSeats={seatCount} onSeatsChange={setSeatCount} pricePerSeat={eventType.priceCents}/>