# Product Quick View

> A quick-view dialog for product grids, built from Product Gallery and Variant Picker. Rating, price and savings, options with stock, a quantity stepper and Add to bag that confirms in place with View bag. Arrows and ← → step to neighbouring products without closing. Also exports QuickViewCard, a tile whose photo swaps on hover and whose Quick view button rises from its foot.

- Slug: `product-quick-view`
- Category: [Commerce](https://www.assembli.design/category/commerce.md)
- Type: component
- Tags: quick-view, product, dialog, ecommerce, add-to-cart, product-grid, variants, shop
- npm dependencies: @base-ui/react, lucide-react, motion
- shadcn/ui dependencies: @assembli/product-gallery, @assembli/variant-picker
- Live preview: https://www.assembli.design/preview/product-quick-view
- Page: https://www.assembli.design/components/product-quick-view

![Product Quick View preview](https://www.assembli.design/thumbnails/product-quick-view-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `products` (required) | `QuickViewProduct[]` |  |  |
| `index` (required) | `number \| null` |  | The product shown, or null when closed. |
| `onIndexChange` (required) | `(index: number \| null) => void` |  |  |
| `onAddToBag` | `(product: QuickViewProduct, selection: VariantSelection, quantity: number) => v…` |  | Return a promise to show "Adding…" until it settles. |
| `onViewBag` | `() => void` |  |  |
| `note` | `React.ReactNode` |  | A line of reassurance under the button. |
| `currency` | `string` | `"USD"` |  |
| `locale` | `string` | `"en-US"` |  |
| `container` | `HTMLElement \| React.RefObject<HTMLElement \| null> \| null` |  | Mount inside this element instead of `<body>`. |
| `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/product-quick-view/product-quick-view.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/product-quick-view
```

Registry item JSON: https://www.assembli.design/r/product-quick-view.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.
