# Swatch Swap Grid block

> Ecommerce Product Grid with Color Swatches, Hover Wishlist, and Sale Price Badges

Responsive 2x2 product collection grid: square media with hover zoom, hover-revealed wishlist toggle, color swatches that swap the image, and strikethrough compare-at price. ReUI Badge, shadcn Card, Button, Item. For shop, catalog, store listing.

- Type: Pro block
- Category: [Product Grid](https://web.dev.reui.io/blocks/ecommerce/product-grid.md)
- Page: https://web.dev.reui.io/blocks/ecommerce/product-grid/product-grid-1
- MCP: `get_block("product-grid-1")`
- Built with: Badge, Button, Card, Item
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

A shadcn Card per tile in 2 columns, where picking a color swatch swaps the photo and names the color

## Agent notes

- `DEFAULT_SELECTED_COLORS` maps a product id to a color name; a name with no match falls back to the first entry of `colors`
- Each swatch dot is filled by the `className` on its `colors` entry, and every entry also needs an `image` and `imageAlt`
- The tile has no cart control, only `href` and `categoryHref` links, so add a buy action if shoppers purchase from the grid

## When not to use

- A saved items page with bulk actions, stock status and price drop signals: use the [Wishlist blocks](https://web.dev.reui.io/blocks/ecommerce/wishlist.md)

## Install

```bash
npx shadcn@latest add @reui/product-grid-1
```

## About Product Grid blocks

### When to use

- A collection or category page body of photo tiles with prices, sale strikethroughs and a wishlist save
- Comparing colorways through swatches, or buying from the listing with a hover size picker or cart button
- Editorial or lookbook edits whose tiles add a story and specs, or fade to an on model photo on hover

### When not to use

- Dashboard tiles for KPIs, people or records in an app, with no price or buy control: use the [Card blocks](https://web.dev.reui.io/blocks/application/card.md)
- A bordered panel surface with header, body and footer slots for content not for sale: use [Frame](https://web.dev.reui.io/components/frame.md) (`get_component("frame")`)
- A listing with its own heading, sort and filter toolbar, breadcrumb or carousel rail: use the [Product Card blocks](https://web.dev.reui.io/blocks/ecommerce/product-card.md)

### Agent notes

- `ProductGrid` takes no props and maps `PRODUCTS` from data.ts, where each `price` is a preformatted string and every `href` is a hash placeholder
- The wishlist toggle only flips the local `likedProducts` set seeded from `DEFAULT_LIKED_PRODUCT_IDS`; persist it to your own wishlist store
- Each page.tsx adds a `min-h-svh` main and `ProductGrid` sets `max-w-6xl` with its own padding; drop both inside your storefront layout

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
