# Size Guide

> A size guide dialog for product pages. Tops, Bottoms and Shoes tabs, a cm/in switch, and a measurement table whose hovered or focused cell lights its row and column like a crosshair. A flat drawing numbers each measurement and lights the one in use. Find my size takes height and chest (or your usual size) plus a preferred fit, and recommends a size with a match score.

- Slug: `size-guide`
- Category: [Commerce](https://www.assembli.design/category/commerce.md)
- Type: component
- Tags: ecommerce, size-guide, size-chart, fit-finder, dialog, apparel, measurements, product-page
- npm dependencies: @base-ui/react, lucide-react, motion
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/size-guide
- Page: https://www.assembli.design/components/size-guide

![Size Guide preview](https://www.assembli.design/thumbnails/size-guide-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `charts` | `SizeChart[]` | `DEFAULT_SIZE_CHARTS` |  |
| `defaultChart` | `string` |  |  |
| `defaultUnit` | `SizeUnit` | `"cm"` |  |
| `selectedSize` | `string` |  | The size chosen on the product, marked in the table. |
| `onSelectSize` | `(size: string, chart: SizeChart) => void` |  | Shows a "Select M" button under the fit finder's recommendation. |
| `productName` | `React.ReactNode` |  |  |
| `open` | `boolean` |  |  |
| `defaultOpen` | `boolean` |  |  |
| `onOpenChange` | `(open: boolean) => void` |  |  |
| `container` | `HTMLElement \| React.RefObject<HTMLElement \| null> \| null` |  | Mount inside this element instead of `<body>`. |
| `trigger` | `React.ReactNode \| null` |  | Trigger content; pass `null` to render no trigger and control `open` yourself. |
| `triggerClassName` | `string` |  |  |
| `className` | `string` |  |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/size-guide/size-guide.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/size-guide
```

Registry item JSON: https://www.assembli.design/r/size-guide.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
