Product Grid

A shop's products in a grid: each with its picture, name, rating and price, a badge when it has one, and a button that adds it to the cart.

Shop

Your headline goes here

A short line about the products goes here.

  • New

    Item 1

    128 reviews

    $48

  • Sale

    Item 2

    64 reviews

    Price $96Original price $120

  • Item 3

    32 reviews

    $32

  • Item 4

    16 reviews

    $72

import { ProductGrid, type ProductItem } from "@produkto/ui/ProductGrid";

const items: ProductItem[] = [
  {
    name: "Item 1",
    price: "$48",
    image: "https://picsum.photos/id/30/640/640",
    rating: 4.5,
    reviews: 128,
    badge: "New",
    link: "#",
  },
  {
    name: "Item 2",
    price: "$96",
    compareAtPrice: "$120",
    image: "https://picsum.photos/id/250/640/640",
    rating: 5,
    reviews: 64,
    badge: "Sale",
    link: "#",
  },
  {
    name: "Item 3",
    price: "$32",
    image: "https://picsum.photos/id/175/640/640",
    rating: 4,
    reviews: 32,
    link: "#",
  },
  {
    name: "Item 4",
    price: "$72",
    image: "https://picsum.photos/id/486/640/640",
    rating: 4.5,
    reviews: 16,
    link: "#",
  },
];

const Example = () => (
  <ProductGrid
    description="A short line about the products goes here."
    eyebrow="Shop"
    items={items}
    onAdd={() => {}}
    title="Your headline goes here"
  />
);

export default Example;

Usage

import { ProductGrid } from "@produkto/ui/ProductGrid";
<ProductGrid
  title="Title"
  columns={4}
  items={[
    {
      name: "Item 1",
      price: "$48",
      compareAtPrice: "$60",
      image: "/item-one.jpg",
      rating: 4.5,
      reviews: 128,
      badge: "Sale",
      link: "/products/item-one",
    },
  ]}
  onAdd={(item) => addToCart(item)}
/>

Examples

Three cards

appearance="solid" frames each item on a card of its own with its line and price, and headerLayout="split" sets the heading on the left and the line and the button on the right.

Eyebrow

Your headline goes here

A short line about the items goes here.

  • Item 1

    A short line about this item goes here.

    $14

  • Item 2

    A short line about this item goes here.

    $13

  • Item 3

    A short line about this item goes here.

    $14

import { ProductGrid, type ProductItem } from "@produkto/ui/ProductGrid";

const items: ProductItem[] = [
  {
    name: "Item 1",
    description: "A short line about this item goes here.",
    price: "$14",
    image: "https://picsum.photos/id/225/800/600",
    link: "#",
  },
  {
    name: "Item 2",
    description: "A short line about this item goes here.",
    price: "$13",
    image: "https://picsum.photos/id/367/800/600",
    link: "#",
  },
  {
    name: "Item 3",
    description: "A short line about this item goes here.",
    price: "$14",
    image: "https://picsum.photos/id/39/800/600",
    link: "#",
  },
];

const Example = () => (
  <ProductGrid
    actions={[{ label: "Button", link: "#", appearance: "outline" }]}
    headerLayout="split"
    appearance="solid"
    columns={3}
    description="A short line about the items goes here."
    eyebrow="Eyebrow"
    items={items}
    title="Your headline goes here"
  />
);

export default Example;

Four tiles

quickAdd sets the add button over each square picture, shown under the pointer or when the item has focus, and always on a touch screen.

Eyebrow

Your headline goes here

A short line about the items goes here.

import { ProductGrid, type ProductItem } from "@produkto/ui/ProductGrid";

const items: ProductItem[] = [
  {
    name: "Item 1",
    price: "$420",
    image: "https://picsum.photos/id/30/640/640",
    link: "#",
  },
  {
    name: "Item 2",
    price: "$120",
    image: "https://picsum.photos/id/250/640/640",
    link: "#",
  },
  {
    name: "Item 3",
    price: "$290",
    image: "https://picsum.photos/id/175/640/640",
    link: "#",
  },
  {
    name: "Item 4",
    price: "$95",
    image: "https://picsum.photos/id/486/640/640",
    link: "#",
  },
];

const Example = () => (
  <ProductGrid
    actions={[{ label: "Button", link: "#", appearance: "outline" }]}
    headerLayout="split"
    description="A short line about the items goes here."
    eyebrow="Eyebrow"
    items={items}
    onAdd={() => {}}
    quickAdd
    title="Your headline goes here"
  />
);

export default Example;

Rows with photos

layout="rows" sets each item's picture beside its name, line and price, two to a row from a tablet up.

Eyebrow

Your headline goes here

A short line about the items goes here.

  • Item 1

    A short line about this item goes here.

    $120

  • Item 2

    A short line about this item goes here.

    $90

  • Item 3

    A short line about this item goes here.

    $65

  • Item 4

    A short line about this item goes here.

    From $150

import { ProductGrid, type ProductItem } from "@produkto/ui/ProductGrid";

const items: ProductItem[] = [
  {
    name: "Item 1",
    description: "A short line about this item goes here.",
    price: "$120",
    image: "https://picsum.photos/id/64/400/400",
    link: "#",
  },
  {
    name: "Item 2",
    description: "A short line about this item goes here.",
    price: "$90",
    image: "https://picsum.photos/id/65/400/400",
    link: "#",
  },
  {
    name: "Item 3",
    description: "A short line about this item goes here.",
    price: "$65",
    image: "https://picsum.photos/id/91/400/400",
    link: "#",
  },
  {
    name: "Item 4",
    description: "A short line about this item goes here.",
    price: "From $150",
    image: "https://picsum.photos/id/177/400/400",
    link: "#",
  },
];

const Example = () => (
  <ProductGrid
    actions={[{ label: "Button", link: "#", appearance: "outline" }]}
    headerLayout="split"
    appearance="solid"
    description="A short line about the items goes here."
    eyebrow="Eyebrow"
    items={items}
    layout="rows"
    title="Your headline goes here"
  />
);

export default Example;

Two columns

columns sets two, three or four products to a row on a wide screen; two make each picture large.

Your headline goes here

A short line about the products goes here.

  • New

    Item 1

    64 reviews

    $148

  • Item 2

    32 reviews

    $96

import { ProductGrid, type ProductItem } from "@produkto/ui/ProductGrid";

const items: ProductItem[] = [
  {
    name: "Item 1",
    price: "$148",
    image: "https://picsum.photos/id/250/960/960",
    rating: 5,
    reviews: 64,
    badge: "New",
    link: "#",
  },
  {
    name: "Item 2",
    price: "$96",
    image: "https://picsum.photos/id/96/960/960",
    rating: 4.5,
    reviews: 32,
    link: "#",
  },
];

const Example = () => (
  <ProductGrid
    align="center"
    columns={2}
    description="A short line about the products goes here."
    items={items}
    onAdd={() => {}}
    title="Your headline goes here"
  />
);

export default Example;

Catalogue

Without ratings or an onAdd each product is its picture, name and price, and the block's actions close the grid.

Your headline goes here

import { ProductGrid, type ProductItem } from "@produkto/ui/ProductGrid";

const items: ProductItem[] = [
  {
    name: "Item 1",
    price: "$48",
    image: "https://picsum.photos/id/30/640/640",
    link: "#",
  },
  {
    name: "Item 2",
    price: "$96",
    image: "https://picsum.photos/id/225/640/640",
    link: "#",
  },
  {
    name: "Item 3",
    price: "$32",
    compareAtPrice: "$40",
    image: "https://picsum.photos/id/175/640/640",
    badge: "Sale",
    link: "#",
  },
  {
    name: "Item 4",
    price: "$72",
    image: "https://picsum.photos/id/367/640/640",
    link: "#",
  },
  {
    name: "Item 5",
    price: "$24",
    image: "https://picsum.photos/id/486/640/640",
    link: "#",
  },
  {
    name: "Item 6",
    price: "$64",
    image: "https://picsum.photos/id/39/640/640",
    link: "#",
  },
  {
    name: "Item 7",
    price: "$56",
    image: "https://picsum.photos/id/96/640/640",
    link: "#",
  },
  {
    name: "Item 8",
    price: "$120",
    image: "https://picsum.photos/id/250/640/640",
    badge: "New",
    link: "#",
  },
];

const Example = () => (
  <ProductGrid
    actions={[{ label: "Primary action", link: "#", appearance: "outline" }]}
    items={items}
    title="Your headline goes here"
  />
);

export default Example;

API Reference

ProductGrid

ProductGridProps · blocks/ProductGrid/ProductGrid.types.ts
PropTypeDefault
itemsProductItem[]-
layoutProductGridLayout"grid" | "rows" | "featured" | "carousel""grid"
columnsProductGridColumns2 | 3 | 44
appearanceProductGridAppearance"solid" | "transparent""transparent"
quickAddbooleanfalse
onAdd(item: ProductItem) => void-
actionsBlockAction[]-
idstring-
eyebrowstring-
titleReactNode-
descriptionReactNode-
alignSectionAlign"start" | "center" | "end""start"
headerLayoutSectionHeaderLayout"stacked" | "split""stacked"
mutedbooleanfalse
classNamestring-

ProductItem

used by items
PropTypeDefault
namerequiredstring-
descriptionstring-
metastring-
pricerequiredstring-
compareAtPricestring-
imagerequiredstring-
altstring-
ratingnumber-
reviewsnumber-
badgestring-
linkrequiredstring-
onAdd() => void-

BlockAction

used by actions
PropTypeDefault
appearanceButtonAppearance"solid" | "soft" | "outline" | "transparent"-
toneButtonTone"neutral" | "accent" | "destructive" | "success" | "warning" | "info"-
iconReactNode-
iconOnlyboolean-
borderRadiusBlockActionBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
labelrequiredstring-
linkrequiredstring-