Skip to content

element.update()

Method@tryyoursize/sdk

Changes the element’s options in place. A new product (or demo body) reloads the element; variant and label restyle it.

update(options: Partial<ElementOptions>): void;
optionsPartial<ElementOptions>Required
Properties
productstringRequired

Your product ID or SKU, as synced to TryYourSize.

variant"link" | "button"Optional

"sizeGuide" only: a text link (default, like most stores' "Size guide") or an outlined button.

labelstringOptional

"sizeGuide" only: your own words for "Size guide" (otherwise localized from locale).

demoDemoOptionsOptional

"fit" only, test keys only: demo mode. The element shows the garment on a named sample body (synthetic size-chart tape values, never a real person's), with no sign-in: size chips, objective numbers in cm and kPa, a turning body and a sample-body picker. For landing pages and sales demos.

Properties
bodystringRequired

A sample body id: sample-female-158, sample-female-165, sample-female-172, sample-male-172, sample-male-178 or sample-male-186.

heightnumberOptional

Height of the element in px (default 640).

colorSelect.addEventListener("change", () => guide.update({ product: colorSelect.value }));

Was this page helpful?