ValyroUI Русская версия

Product Grid

Product catalog. Pro · Shop and payments › Catalog

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add product-grid
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { ProductGrid } from 'valyro-ui-pro';

Props

PropTypeDefault
products *ProductGridItem[]Products in display order; sorting and paging are up to the caller.
totalCountnumberSize of the whole result set (defaults to products.length).
currencystringISO 4217 code for products without their own currency.
loadingbooleanfalseInitial load: renders skeleton cards instead of products.
sortOptionsProductSortOption[]DEFAULT_SORT_OPTIONSChoices of the sort menu; an empty list hides it. Without a sort value the first one is selected.
sortstringControlled sort; use with onSortChange.
defaultSortstringInitial sort when uncontrolled.
onSortChange(value: string) => voidCalled with the new sort when it changes.
view'grid' | 'list'Controlled view; use with onViewChange.
defaultView'grid' | 'list''grid'Initial view when uncontrolled.
onViewChange(view: ProductGridView) => voidCalled with the new view when it changes.
hasMorebooleanfalseShows the "Load more" button.
loadingMorebooleanfalseThe next page is loading: skeleton cards follow the products and Load more shows a spinner.
onLoadMore() => voidCalled by the Load more button.
onAddToCart(product: ProductGridItem) => void | Promise<void>Called by a card's add button; a returned promise keeps it loading until it settles.
onWishlistedChange(product: ProductGridItem, wishlisted: boolean) => voidCalled when a card's wishlist heart is toggled; each card keeps its own state.
emptyReactNodeReplaces the default empty state.
localestringLocale for prices and counts (default: the ThemeProvider's, then the browser's).
labelsPartial<ProductGridLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Product Card · Next: Product Filters · All Shop and payments