@ticketss/interactive-floor-plan renders a buyer-facing map from a saved FloorPlanDocument produced by the editor.
import { InteractiveFloorPlan } from "@ticketss/interactive-floor-plan";
import "@ticketss/floor-plan-editor/styles/tokens.css";
import "@ticketss/interactive-floor-plan/styles/interactive.css";
<div style={{ width: "100%", height: "60dvh" }}>
<InteractiveFloorPlan
document={floorPlan}
selectedIds={selectedIds}
onSelectionChange={setSelectedIds}
onPick={(pick) => console.log(pick)}
isDarkMode
/>
</div>| Prop | Type | Description |
|---|---|---|
document | FloorPlanDocument | Read-only floor plan JSON from the organizer editor |
selectedIds | string[] | Controlled selection state (seats, tables, GA zones) |
onSelectionChange | (ids) => void | Called when the user picks or clears seats/zones |
availability | AvailabilityMap | Host overlay for sold / held / locked inventory |
onPick | (InteractivePick) => void | Resolved pick metadata for cart / analytics |
onPickRejected | (PickRejectedEvent) => void | Unavailable target clicked |
isDarkMode | boolean | Maps to data-theme on the root |
canvasBackgroundColor | string | Canvas background hex color (controlled) |
onCanvasBackgroundColorChange | (color) => void | Called when the user changes canvas background via the picker |
styles | InteractiveFloorPlanStyles | Optional chrome and seat selection color overrides |
width: 100%; height: 100% of the parent.entireTable picks the whole table; singleSeat picks individual seats.Mock availability for the live preview (host app supplies real inventory in production):
Pass styles with keys root, canvas, zoomToolbar, zoomButton, zoomLabel, backgroundPicker, backgroundPickerSwatch, tooltip, and seatSelection for selected seat fill/stroke on the canvas.
seatSelection.fill and seatSelection.stroke accept a single color string or { light, dark } objects resolved using isDarkMode.
styles={{
seatSelection: {
fill: { light: "#2563EB", dark: "#22D3EE" },
stroke: { light: "#1E40AF", dark: "#0891B2" },
},
zoomToolbar: { backgroundColor: "rgba(0,0,0,0.6)" },
}}