Tally UI

ProductGrid

ProductGrid renders products in a scrollable column layout with custom item rendering, search and filter slots, and an optional empty state.

Import

import { ProductGrid } from '@tallyui/components';

Usage

<ProductGrid
  items={products}
  renderItem={(doc) => <ProductCard doc={doc} />}
  searchSlot={<SearchInput value={query} onChangeText={setQuery} />}
  filterSlot={<FilterChipGroup chips={chips} onChipPress={handleChip} />}
  numColumns={3}
/>

A scrollable product grid with optional search and filter slots rendered above the grid. Uses a FlatList with numColumns, so only rows near the viewport render on native and web.

Props

PropTypeDefaultDescription
itemsany[]requiredArray of product documents
renderItem(item, index) => ReactNoderequiredRender function for each product
numColumnsnumber2Number of columns in the grid
searchSlotReactNode—Search input rendered above the grid
filterSlotReactNode—Filter chips rendered between search and grid
emptyStateReactNode—Content shown when items array is empty
showUnsellablebooleanfalseShows products the channel doesn't sell (traits.product.isSellable false), which are hidden otherwise
footerSlotReactNode—Rendered after the last tile, inside the list (for example a paging spinner); not shown with emptyState
classNamestring—Override container styles

Slot pattern

ProductGrid doesn't own the search or filter state. It provides layout slots, and you pass in the components you want. This keeps filtering logic in your application code where it belongs.

const filtered = products.filter((p) =>
  p.name.toLowerCase().includes(query.toLowerCase())
);

<ProductGrid items={filtered} renderItem={...} searchSlot={...} />

Live demo