# <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.

Source: https://docs.tryyoursize.com/reference/web/tys-size-guide/

*Web component* · `@tryyoursize/sdk/elements`

The size guide element as a tag: "Size guide" with the TryYourSize mark, then "Your size: M" once the shopper is connected.

## Attributes

- **`publishable-key`** (`string`, required): Your publishable key (`pk_test_…` / `pk_live_…`).
- **`product`** (`string`, required): Your product ID or SKU.
- **`variant`** (`"link" | "button"`, optional): A text link (default) or an outlined button.
- **`label`** (`string`, optional): Your own words for "Size guide" (otherwise localized).
- **`locale`** (`string`, optional): BCP 47 language; default: your page's `<html lang>`, then the browser.

## Example

**HTML**

```html
<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

- [Shopify (no code)](https://docs.tryyoursize.com/quickstarts/shopify.md)
- [Size guide quickstart](https://docs.tryyoursize.com/quickstarts/size-guide.md)
