Skip to Content

Options

Every AI Try-On option, with its name in each way to install.

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

An option marked Required must be set. Without the product type the dialog does not open, and with data attributes it also needs the name and the image. Always pass your key: it ties the try-ons to your account and its allowed domains.

AttributeJavaScript and ReactTypeDefaultDescription
data-vizbl-ai-try-on-product-typeproductTypeProductTypeRequiredProduct category.
data-vizbl-ai-try-on-product-nameproductNamestringRequiredProduct name shown in the dialog.
data-vizbl-ai-try-on-product-image-srcproductImageSrcstringRequiredProduct image URL.
data-vizbl-ai-try-on-product-priceproductPricestring-Already-formatted product price.
data-vizbl-ai-try-on-product-urlproductUrlstring-Product page URL opened from the result.
data-vizbl-ai-try-on-product-refproductRefstring-Your store's own id for the product, so the dashboard counts openings and add-to-cart clicks per product. The dashboard's widget code sets it for you.
data-vizbl-ai-try-on-languagelanguage'en' | 'ru'Browser languageThe widget's language.
data-vizbl-ai-try-on-api-keyapiKeystringRequiredPublishable key.

ProductType

type ProductType = 'full-body' | 'upper-body' | 'lower-body' | 'footwear' | 'headwear' | 'eyewear' | 'neck' | 'wrist' | 'bag' | 'waist'

Product types says what each ProductType covers.

What JavaScript and React add

  • JavaScript: the AiTryOnDialog class, its target and destroy().
  • React: the dialog component and its open state.

On this page