Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development
ProductGrid

Lists the products available in the store.

The ProductGrid is a section generally used on PLP pages to list the products available in the store.The ProductGrid is a compound of the following:
  • ProductGrid: wraps the product grid items.
  • ProductGridItem: wraps the product inside a list item.
  • ProductCard: the proposed child of a ProductGridItem.
Example
Code

Usage

Import the component


_10
import { ProductGrid, ProductGridItem } from "@faststore/ui";

We highly recommend using the ProductCard as the direct child of the ProductGridItem.

_10
import {
_10
ProductCard,
_10
ProductCardContent,
_10
ProductCardImage,
_10
} from "@faststore/ui";

Import styles

To apply styles, include the following in your stylesheet:

_10
@import "@faststore/ui/src/components/organisms/ProductGrid/styles.scss";


Design tokens

Local tokenDefault value/Global token linked
--fs-product-grid-gap-mobilevar(--fs-grid-gap-0)
--fs-product-grid-gap-tabletvar(--fs-product-grid-gap-mobile)
--fs-product-grid-gap-desktopvar(--fs-grid-gap-2)
--fs-product-grid-columns-mobile2
--fs-product-grid-columns-tablet4
--fs-product-grid-columns-desktopvar(--fs-product-grid-columns-tablet)

Data attributes

You can target and override ProductGrid styles using the following data attributes: data-fs-product-grid
data-fs-product-grid-item

Props

ProductGrid

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).fs-product-grid

ProductGridItem

NameTypeDescriptionDefault
testIdstringID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest).fs-product-grid-item

Best Practices

✅ Do's

  • Respect ProductGridItem content's width considering the space available on the page.

❌ Don'ts

  • Avoid using a lot of ProductGridItem on the same row, this could lead to unwanted horizontal scroll.

Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
On this page