# Related Products block

> Similar products carousel of product cards with wishlist, discount and stock badges

Shoppable carousel of product cards with wishlist toggle, percent-off discount and low-stock urgency badges, page counter, and prev/next controls. Uses ReUI Badge; shadcn Card, Carousel, Button. For related products, recommendations, and cross-sell.

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

## Best for

A related items carousel with a page counter badge beside its heading, an items left badge on low stock tiles and no cart buttons

## Agent notes

- `ProductList` slices `items` into pages of 4 to match the 4 column grid, and the page counter reads `currentPage` and `pageCount` from the carousel `api`
- `urgencyBadge` and `discountBadge` hold fixed labels such as 4 left; derive them from stock and price
- `likedProducts` is keyed by each product `id` and only holds local state; give every item a unique `id` and persist the wishlist yourself

## When not to use

- A carousel whose tiles each need a hover add to cart button: use [New Arrivals Carousel](https://web.dev.reui.io/blocks/ecommerce/product-card/product-card-7.md) (`get_block("product-card-7")`)

## Third-party libraries

- Embla Carousel v8: [API reference](https://www.embla-carousel.com/docs/v8/api), [docs](https://www.embla-carousel.com/docs/v8/get-started/react), through shadcn Carousel

## Install

```bash
npx shadcn@latest add @reui/product-card-4
```

## About Product Card blocks

### When to use

- A catalog or collection page of items for sale, from a plain tile grid to one with filters and sort
- A similar items or latest arrivals row that pages through 4 tiles at a time with arrow buttons
- A single item quick buy panel with a size or finish picker beside add to bag and wishlist buttons

### When not to use

- Dashboard or admin tiles for metrics, records or settings, with nothing for sale: use the [Card blocks](https://web.dev.reui.io/blocks/application/card.md)
- Departments or collections to browse into, with no per item price or buy control: use the [Category Card blocks](https://web.dev.reui.io/blocks/ecommerce/category-card.md)
- A full page for one item with its gallery, spec tables, reviews and related items: use the [Product Detail blocks](https://web.dev.reui.io/blocks/ecommerce/product-detail.md)

### Agent notes

- `ProductCard` takes no props and renders demo items defined in its own files; add a prop to pass in your catalog
- Every `price` and `compareAtPrice` is a preformatted dollar string; format amounts and currency before you pass them
- Each page.tsx wraps `ProductCard` in a padded `min-h-svh` wrapper; strip it when the block sits 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.
