ComponentsFloorplan

FloorplanModal

Interactive floorplan navigation component with customizable UI elements.

Props

PropTypeDefaultDescription
openbooleanfalseControls modal visibility
floorIdstringundefinedCurrently selected floor ID
onChange(open: boolean, floorId: string) => voidundefinedCallback for floor/visibility changes
showCamerasbooleanfalseShows camera positions on floorplan
titlestringundefinedModal title
subtitlestringundefinedModal subtitle
borderRadiusnumberundefinedModal corner radius
sidebarPropsobjectundefinedStyle props for sidebar container
floorItemBuilder(room, selected, onClick) => ReactElementundefinedCustom floor item renderer
roomItemBuilder(room, selected, onClick) => ReactElementundefinedCustom room item renderer

Custom Builders Examples

Floor Item

<FloorplanModal
  floorItemBuilder={(floor, selected, onClick) => (
    <button 
      onClick={onClick}
      style={{
        background: selected ? "rgba(255,255,255,0.1)" : "none",
        borderLeft: selected ? "solid 4px rgb(0,100,255)" : "solid 4px rgba(0,0,0,0)",
        // ... other styles
      }}>
      {floor.name}
    </button>
  )}
/>

Room Item

<FloorplanModal
  roomItemBuilder={(room, selected, onClick) => (
    <button 
      onClick={onClick}
      style={{
        background: selected ? "rgba(255,255,255,0.2)" : "none",
        borderLeft: selected ? "solid 4px rgb(0,200,255)" : "solid 4px rgba(0,0,0,0)",
        // ... other styles
      }}>
      {room.name}
    </button>
  )}
/>

The sidebarProps prop allows complete customization of the sidebar container’s appearance. This is useful for matching your application’s design system or creating unique visual effects.

Full Example with Custom Sidebar

<Space 
    tourId="cm3x8uz3e0001kb8jujco03r9"
		style={{ width: "100%", height: "500px", margin: "20px 0px" }}
	>
		<Overlay>
			<FloorplanModal
				open={true}
				title={"4 Bed Villa"}
				subtitle={"Select a room"}
				floorItemBuilder={(floor, selected, onClick) => <FloorListItem floor={floor} onClick={onClick} selected={selected} />}
				roomItemBuilder={(room, selected, onClick) => <RoomListItem room={room} onClick={onClick} selected={selected} />}
				borderRadius={0}
				sidebarProps={{
					style: {
						"background": "rgba(0,100,250,0.1)",
						"borderRadius": "0px",
						"padding": "0px",
						"color": "white",
						border: "none",
						"backdropFilter": "blur(20px)",
					}
				}}
			></FloorplanModal>
			<Loading />
			<Toolbar config={{
				floorplan: true,
				resolution: true,
				measurement: false,
				configurator: false,
 
			}} />
		</Overlay>
 
	</Space>

Show Cameras

Show Rooms