<tys-size-guide>
The size guide element as a tag: “Size guide” with the TryYourSize mark, then “Your size: M” once the shopper is connected.
Attributes
Section titled “Attributes”publishable-keystringRequiredYour publishable key (pk_test_… / pk_live_…).
productstringRequiredYour product ID or SKU.
variant"link" | "button"OptionalA text link (default) or an outlined button.
labelstringOptionalYour own words for "Size guide" (otherwise localized).
localestringOptionalBCP 47 language; default: your page's <html lang>, then the browser.
Example
Section titled “Example”<script src="https://js.tryyoursize.com/v1/tys.js"></script>
<tys-size-guide publishable-key="pk_test_…" product="SKU-123" variant="link"></tys-size-guide>
<script> document.querySelector("tys-size-guide") .addEventListener("tys:recommendation", (e) => e.detail.status === "ready" && preselect(e.detail.size));</script>See also
Section titled “See also”Was this page helpful?
Thank you. We read every answer.