Skip to Content

Options

Every Room Viewer option, with its attribute, JavaScript and React name and the types it applies to.

Each row is one option. With a script tag, set it as a data attribute on the trigger. In JavaScript, pass it to new RoomViewerDialog(target, options) under its JavaScript name; a value you pass there wins over the attribute. In React, it is a prop of RoomViewerDialog; the inline RoomViewer takes every option except productRef and disableClose.

An option marked Required in the Default column must be set for the types in its Applies to column. An option has no effect on other types.

AttributeJavaScript and ReactTypeDefaultApplies toDescription
data-vizbl-room-viewer-typetypeRoomViewerResourceTypeRequiredAllWhat the product is and where it goes in the room.
data-vizbl-room-viewer-srcsrcstringRequiredwallartWall-art image URL.
data-vizbl-room-viewer-tinuuidtinuuidstringRequiredrugs, flooring, wallcoveringThe object's tinuuid.
data-vizbl-room-viewer-room-idroomIdstring-AllThe id of the room to open in, the initial room. Skips the room chooser; a room that is not available opens the chooser. An empty value does nothing.
data-vizbl-room-viewer-namenamestringRequiredAllThe product's name: the dialog's accessible title and the name on the wall-art product card.
data-vizbl-room-viewer-widthwidthnumberRequiredwallartPhysical width of the artwork, in dimension-unit.
data-vizbl-room-viewer-heightheightnumberRequiredwallartPhysical height of the artwork, in dimension-unit.
data-vizbl-room-viewer-dimension-unitdimensionUnitRoomViewerDimensionUnitmwallartUnit used by wall-art width and height.
data-vizbl-room-viewer-display-unitdisplayUnitRoomViewerDisplayUnitcmAllUnit used to display UI measurements.
data-vizbl-room-viewer-languagelanguage'en' | 'ru' | 'ar'User localeAllThe widget's language, in place of the browser's.
data-vizbl-room-viewer-api-keyapiKeystringRequiredAllYour publishable key.
data-vizbl-room-viewer-product-refproductRefstring-AllYour store's own id for the product, so the dashboard counts views per product. The dashboard's widget code sets it for you.
data-vizbl-room-viewer-disable-closedisableClosebooleanfalseAllSet to true to hide close controls and prevent dismissal.

Numbers and booleans are written as text in attributes: data-vizbl-room-viewer-width="60", data-vizbl-room-viewer-disable-close="true".

RoomViewerResourceType

type RoomViewerResourceType = 'wallart' | 'rugs' | 'flooring' | 'wallcovering'

RoomViewerDimensionUnit

type RoomViewerDimensionUnit = 'm' | 'cm' | 'in'

RoomViewerDisplayUnit

type RoomViewerDisplayUnit = 'cm' | 'in'

What JavaScript and React add

  • JavaScript: the RoomViewerDialog class, its target and destroy().
  • React: the dialog and inline components and the dialog's open state.

On this page