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.
| Attribute | JavaScript and React | Type | Default | Applies to | Description |
|---|---|---|---|---|---|
data-vizbl-room-viewer-type | type | RoomViewerResourceType | Required | All | What the product is and where it goes in the room. |
data-vizbl-room-viewer-src | src | string | Required | wallart | Wall-art image URL. |
data-vizbl-room-viewer-tinuuid | tinuuid | string | Required | rugs, flooring, wallcovering | The object's tinuuid. |
data-vizbl-room-viewer-room-id | roomId | string | - | All | The 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-name | name | string | Required | All | The product's name: the dialog's accessible title and the name on the wall-art product card. |
data-vizbl-room-viewer-width | width | number | Required | wallart | Physical width of the artwork, in dimension-unit. |
data-vizbl-room-viewer-height | height | number | Required | wallart | Physical height of the artwork, in dimension-unit. |
data-vizbl-room-viewer-dimension-unit | dimensionUnit | RoomViewerDimensionUnit | m | wallart | Unit used by wall-art width and height. |
data-vizbl-room-viewer-display-unit | displayUnit | RoomViewerDisplayUnit | cm | All | Unit used to display UI measurements. |
data-vizbl-room-viewer-language | language | 'en' | 'ru' | 'ar' | User locale | All | The widget's language, in place of the browser's. |
data-vizbl-room-viewer-api-key | apiKey | string | Required | All | Your publishable key. |
data-vizbl-room-viewer-product-ref | productRef | string | - | All | Your 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-close | disableClose | boolean | false | All | Set 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
RoomViewerDialogclass, its target anddestroy(). - React: the dialog and inline components and the dialog's open state.