<FitElement>
The inline element (sign-in and “your body is ready” in your page). Recommended.
Pass a ref to get an ElementHandle (open(), close(), getRecommendation(), getElement()).
FitElement: ForwardRefExoticComponent<ElementProps & RefAttributes<ElementHandle>>productstringRequiredYour product identifier, as synced to TryYourSize. Changing it updates the element in place.
idstringOptionalclassNamestringOptionalstyleCSSPropertiesOptionalonReady(e: ElementEvents["ready"]) => voidOptionalThe element is shown and connected.
onSize(e: SizeEvent) => voidOptionalThe shopper got a size for this product: preselect the variant.
onOpen(e: ElementEvents["open"]) => voidOptionalonClose(e: ElementEvents["close"]) => voidOptionalonLoadError(e: ElementEvents["loaderror"]) => voidOptionalOur window could not be reached (network, CSP).
onRecommendation(r: Recommendation) => voidOptionalThe shopper's recommended size in your size labels: on mount when they are already connected, and on every change. Sizes only. Preselect your picker.
demoDemoOptionsOptional<FitElement> only, test keys only: demo mode on a named sample body, no sign-in (landing pages). Changing demo.body switches the body in place.
Properties
bodystringRequiredA sample body id, e.g. sample-female-165.
heightnumberOptionalHeight of the element in px (default 640).
Example
Section titled “Example”<FitElement product="STRAIGHT-JEANS" onSize={({ size }) => selectVariant(size)} />elements.create("fit", { product: "STRAIGHT-JEANS" }).mount("#tys-fit");Was this page helpful?
Thank you. We read every answer.