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.
| Attribute | JavaScript and React | Type | Default | Description |
|---|---|---|---|---|
data-vizbl-ai-try-on-product-type | productType | ProductType | Required | Product category. |
data-vizbl-ai-try-on-product-name | productName | string | Required | Product name shown in the dialog. |
data-vizbl-ai-try-on-product-image-src | productImageSrc | string | Required | Product image URL. |
data-vizbl-ai-try-on-product-price | productPrice | string | - | Already-formatted product price. |
data-vizbl-ai-try-on-product-url | productUrl | string | - | Product page URL opened from the result. |
data-vizbl-ai-try-on-product-ref | productRef | string | - | 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-language | language | 'en' | 'ru' | Browser language | The widget's language. |
data-vizbl-ai-try-on-api-key | apiKey | string | Required | Publishable 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
AiTryOnDialogclass, its target anddestroy(). - React: the dialog component and its open state.