Skip to main content

List Products Grid Block

ListProductsGrid is a responsive card grid and list view built on MUI Stack with Card items, supporting horizontally scrollable chip filters, line clamping, and complete compound layout customization.

Installationโ€‹

npm install @nodeblocks/frontend-list-products-grid-block

What You Needโ€‹

ItemWhy it matters
itemsOptional array of product card configurations for ListProductsGrid.Items.GridCard
layout (optional)Preset layout: responsive multi-column grid ('grid') or single-column list ('list')
listProductsGridTitle (optional)Main super-title text or custom React node
subtitle (optional)Secondary title displayed above the main title
Controlled component

ListProductsGrid acts as a presentational listing block. Provide card data through items or pass children elements to render custom catalog items (see Compound Components).

Code Examplesโ€‹

Live Editor
function Example() {
  const products = [
    {
      title: 'Handcrafted Oak Console',
      subtitle: 'Premium artisan collection',
      summary: 'Handcrafted solid-oak media console with cable management and soft-close drawers.',
      imageUrl: 'https://images.unsplash.com/photo-1540555700478-4be289fbecef?auto=format&fit=crop&w=640&q=80',
      chips: [{ label: 'New', color: 'warning' }],
      tags: [{ label: 'In Stock' }],
    },
    {
      title: 'Ergonomic Desk Chair',
      subtitle: 'Office comfort collection',
      summary: 'Task chair with adjustable lumbar support, 3D armrests, and breathable mesh back.',
      imageUrl: 'https://images.unsplash.com/photo-1505797149-43b0069ec26b?auto=format&fit=crop&w=640&q=80',
      chips: [{ label: 'Sale', color: 'primary' }],
      tags: [{ label: 'Free Shipping' }],
    }
  ];

  return (
    <div style={{ minHeight: 400 }}>
      <ListProductsGrid
        listProductsGridTitle="Featured Products"
        subtitle="Latest Collection"
        items={products}
        layout="grid"
      />
    </div>
  );
}
Result
Loading...

Important Propsโ€‹

Core Propsโ€‹

PropTypeRequiredDefaultDescription
itemsComponentProps<typeof ListProductsGrid.Items.GridCard>[]NoundefinedOptional array of product card configurations rendered in the default Items layout
layout'grid' | 'list'No'grid'Layout preset for the list items (grid: 3-column responsive row; list: vertical single column)

Content Propsโ€‹

PropTypeRequiredDefaultDescription
listProductsGridTitleReactNodeNoundefinedMain super-title text or custom React element displayed in Title block
subtitlestringNoundefinedSecondary category label displayed above the main title

GridCard Propsโ€‹

Configure properties directly on the product cards inside items or pass them directly to <ListProductsGrid.Items.GridCard /> subcomponents:

PropTypeRequiredDefaultDescription
titlestringYes-Primary title of the product card
subtitlestringNoundefinedSecondary text or meta category listed below the title
summaryReactNodeNoundefinedMain card description; clamped to 3 lines on xs and 2 lines on sm+ with ellipsis
imageUrlstringNoundefinedMain image URL centered at the top of the card
subtitleImageUrlstringNoundefinedSmall icon or avatar URL displayed next to the subtitle text
chips(ChipProps & { label: string })[]NoundefinedStatus tags and badges mapped inside a horizontally scrollable container
tags{ icon?: ReactElement; label: string | string[] }[]NoundefinedIcon tags listed below the card divider (joined by / if label is an array)
linkProps{ href?: string; onClick?: (e: React.MouseEvent) => void; onNavigate: ((href: string) => void) | 'standard-html-link'; openInNewTab?: boolean }NoundefinedClick configuration for card navigation
disabledbooleanNofalseWhen true, disables interaction and lowers card opacity
directionStackProps['direction']Nocolumn in grid layout, responsive column/row in list layoutFlex alignment layout (overrides the layout-based default)
actionAreaReactNodeNoundefinedOptional trailing node (such as favorite or options icon button) in the title row
cardContentPropsPartial<Omit<CardContentProps, 'children'>>NoundefinedOverrides passed directly to the inner MUI CardContent component
mainStackPropsPartial<StackProps>NoundefinedCustom styling overrides for the card layout stack
colInnerPropsPartial<StackProps>NoundefinedCustom overrides for the interior column layout stack
titleStackPropsPartial<StackProps>NoundefinedOverrides passed to the title/subtitle text container

Layout and Composition Propsโ€‹

PropTypeRequiredDefaultDescription
childrenBlocksOverride | ReactNodeNoundefinedCompound JSX children or function override returning blocks and blockOrder
spacingStackProps['spacing']No5Layout spacing (theme units) between the title and catalog items
classNamestringNoundefinedCustom class name applied to the root container
sxSxPropsNoundefinedMUI system styles for the root Stack container

ListProductsGrid inherits all StackProps (except children). Default block order without overrides is ['title', 'items'] (defaultBlockOrder).

Default UI Blocksโ€‹

BlockBuilt onNotes
ListProductsGrid (root)StackControlled flex wrapper (direction="column", spacing={5})
ListProductsGrid.TitleStack + TypographyRenders subtitle super-header (variant h4) and title header (variant h1)
ListProductsGrid.ItemsBoxCSS Grid container. Spreads columns responsive to layout prop: 'grid' (3 columns) or 'list' (1 column)
ListProductsGrid.Items.GridCardCardMain product layout card; nests CardMedia, HorizontalScrollEdgeArrows, and metadata columns

TypeScriptโ€‹

import { ListProductsGrid } from '@nodeblocks/frontend-list-products-grid-block';
import type { ComponentProps } from 'react';

type GridCardConfig = ComponentProps<typeof ListProductsGrid.Items.GridCard>;

const products: GridCardConfig[] = [
{
title: 'Solid Oak Console Table',
subtitle: 'Limited artisan release',
summary: 'A beautiful console hand-built from premium white oak.',
imageUrl: 'https://example.com/oak-table.jpg',
chips: [{ label: 'New', color: 'warning' }],
linkProps: {
href: '/products/oak-table',
onNavigate: 'standard-html-link',
}
}
];

<ListProductsGrid
listProductsGridTitle="Our Showroom"
subtitle="Handcrafted Furniture"
items={products}
layout="grid"
/>;