Quick-Shop Product Grid

Product grid with a left filter sidebar where hovering a card reveals a quick-shop tray with sizes and an add-to-cart button, plus a category tag and sale badge, powered by the shared product-filters engine. Self-fetches from your API via productsUrl with an SSR-friendly first page, runs client-side on a dataset, or emits queries in controlled server mode.

PRO

Productlist4: Quick-Shop Product Grid

A product grid with a left filter sidebar where hovering any card slides up a quick-shop tray: selectable size chips plus an "Add to cart" button, without leaving the grid. Cards also show a category tag and a sale/new badge. The toolbar above the grid holds the result count with removable active-filter chips, a mobile "Filters" button, and a sort dropdown; pagination is Previous/Next.

Filtering is powered by the shared product-filters engine, which installs automatically with the block.

Upgrade to Pro

Pro blocks install through the shadcn CLI with your license key and ship their full source. Docs and live previews stay open to everyone, so you can read every block's details first.

Installation

Swap YOUR_EMAIL and YOUR_KEY for the email and license key on your account. Find your license key on your account page.

Radix flavor

bash
npx shadcn add "https://ui.beste.co/r/productlist4?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

bash
npx shadcn add "https://ui.beste.co/r-base/productlist4?email=YOUR_EMAIL&license_key=YOUR_KEY"

Quick start

The installed file exports productlist4Demo alongside the block: the exact props behind the preview above. Spread it to get a working grid in one line.

tsx
import { Productlist4, productlist4Demo } from "@/components/beste/block/productlist4";

export default function Shop() {
  return <Productlist4 {...productlist4Demo} />;
}

Then replace the demo with your own props. Written out, the same setup looks like this:

tsx
import { Productlist4 } from "@/components/beste/block/productlist4";

export default function Shop() {
  return (
    <Productlist4
      heading="Shop the collection"
      pageSize={9}
      productsUrl="/api/products"
      onAddToCart={(product, size) =>
        console.log("add", product.title, size)
      }
      filterGroups={[
        { id: "q", label: "Search", type: "search", placeholder: "Search products" },
        {
          id: "category",
          label: "Category",
          type: "checkbox",
          options: [{ label: "Shoes", value: "shoes" }],
        },
        { id: "price", label: "Price", type: "slider", min: 0, max: 300, step: 5, unit: "$" },
      ]}
    />
  );
}

Quick-shop tray

Each card reads its available sizes from product.sizes (falling back to product.attributes.size) and renders them as selectable chips on hover. Clicking "Add to cart" calls onAddToCart(product, selectedSize) (with selectedSize null if none picked). When you don't pass onAddToCart, the button logs the full product plus selected size to the console so you can see it working. The tray is a hover interaction (desktop pattern); on touch, tapping the image or title navigates to the product.

Props

PropTypeDefaultDescription
headingstringSection heading
descriptionstringSection intro text
productsUrlstringEndpoint the block fetches itself on every query (Data modes); products is ignored while set
initialProductsProductItem[]SSR-fetched first page; skips the initial client fetch
initialTotalCountnumberTotal matches for initialProducts
productsProductItem[][]Client mode dataset; ignored while productsUrl is set
filterGroupsProductFilterGroup[][]Sidebar filter definitions, rendered in order
sortOptionsProductSortOption[][]Sort dropdown entries ({ label, value }). Omit to hide the dropdown
defaultSortstringfirst sort optionInitially selected sort value
defaultFiltersRecord<string, string[]>{}Initial selections keyed by group id, e.g. { category: ["shoes"] }. Restore from the URL
pageSizenumber9Products per page
mode"client" | "server""client"See Data modes. productsUrl implies server behavior
totalCountnumberproducts.lengthServer mode: total matches across all pages, drives pagination
isLoadingbooleanfalseServer mode: shows the skeleton grid while fetching
onAddToCart(product: ProductItem, size: string | null) => voidlogs to consoleQuick-add handler from a card's hover "Add" button
onQueryChange(query: ProductQuery) => voidCalled on every filter, sort, and page action
classNamestringExtra classes for the outer <section>

ProductItem

ts
{
  title: string;
  href: string;
  brand?: string;
  price: number;
  compareAtPrice?: number;
  image: { src: string; alt: string };
  badge?: string;
  rating?: number;
  reviewCount?: number;
  sizes?: string[];             // quick-shop chips; falls back to attributes.size
  keywords?: string[];          // extra terms matched by "search"
  attributes?: Record<string, string[]>; // filterable values keyed by group id
}

attributes keys must match your filterGroups ids. A product matches an option group when any of its attribute values is selected. The card's category tag reads attributes.category[0].

Filter groups

Each entry in filterGroups is a ProductFilterGroup:

FieldTypeDescription
idstringUnique key; option-based groups match product.attributes[id]
labelstringGroup heading
typeProductFilterTypeOne of the types below (default checkbox)
optionsProductFilterOption[]Required for option-based types
min / max / stepnumberBounds for slider (and placeholders for range)
unitstringPrefix for numeric values, e.g. "$"
placeholderstringSearch input / dropdown trigger placeholder
dependsOnstringCascading: parent group id (see below)
ts
type ProductFilterOption = {
  label: string;
  value: string;
  count?: number;
  swatch?: string;
  parentValue?: string;
  children?: ProductFilterOption[];
};

Filter types

typeControlSelectionMatched against
checkboxcheckbox listmultiattributes[id]
radioradio listsingle (click active to clear)attributes[id]
chipsbutton chipsmultiattributes[id]
segmentedsegmented tabssingle (click active to clear)attributes[id]
swatchcolor circlesmultiattributes[id]
toggleswitch rowsmultiattributes[id]
selectdropdownsingleattributes[id]
multiselectcheckbox dropdownmultiattributes[id]
comboboxsearchable dropdownsingle or multi (multiple)attributes[id]
treenested checkboxesmulti (parent covers subtree)attributes[id]
ratingstar rows ("n & up")singleproduct.rating (minimum)
pricecheckbox bucketsmultiproduct.price (option values are "min-max")
sliderrange slidersingle rangeproduct.price; needs min/max/step
rangemin/max number inputssingle range, open-endedproduct.price
searchtext inputtextproduct.title + product.keywords, every word must match

Cascading filters (dependsOn)

A group with dependsOn: "<parentId>" stays disabled until its parent has a selection, and clears whenever the parent changes. Static: tag options with parentValue. Dynamic: leave options empty and pass loadOptions to the engine.

Filter components

Every control this block renders is an individual Beste UI filter component from the Filter category — browse, preview, and install any of them on their own there:

filter-checkbox, filter-radio, filter-chips, filter-segmented, filter-swatch, filter-toggle, filter-select, filter-multiselect, filter-combobox, filter-tree, filter-rating, filter-slider, filter-range, filter-search.

They are wired together by the hidden product-filters engine that ships with this block, so a single install pulls in every control plus the state, debounce, cascading, and query logic. To build your own layout, use the engine directly: useProductFilters + ProductFilterField (renders the right control per group) + ProductFilterChips, with matchesProductFilters and sortProducts backing client mode.

Data modes

Supply products in one of three ways:

  1. Client — pass the full products array; filtering, sorting, and pagination run locally.
  2. Remote (productsUrl) — the block fetches each page itself. The endpoint receives ?filters=<json>&sort=&page=&pageSize= and returns { products, totalCount }. Pair with initialProducts for an SSR first page.
  3. Server (mode: "server") — you own the fetching; every action calls onQueryChange, and you feed products + totalCount back through props.

ProductQuery

ts
{
  filters: Record<string, string[]>; // selections per group id
  sort: string;                      // current sort value
  page: number;                      // 1-based
  pageSize: number;
}

Filter value shapes inside filters: option groups → arrays of option values; slider/range → a single "min-max" string (open ends allowed, "50-" = 50 and up); search → a single string.

Behavior notes

Wiring the form up

This block ships the form markup only; state, validation, and submit are yours to add. Our guide wires the shadcn Field primitives to React Hook Form, TanStack Form, and Formisch on one field system.

More Product List blocks

View all Product List
PRO

productlist1

Filterable Product Grid

Product listing with sidebar filters, sorting, pagination, and active filter chips, powered by the shared product-filters engine. Fifteen filter types including checkboxes, chips, color swatches, price sliders, rating, search, dropdowns, and cascading selects. Runs fully client-side on a given dataset, self-fetches from your API via productsUrl with an SSR-friendly first page, or emits queries in controlled server mode.

PRO

productlist2

Product Grid With Filter Drawer

Product catalog with a single Filters button that opens a side drawer: keyword search, cascading category and subcategory selects, a searchable multi-brand combobox, a size multiselect, and a segmented gender control, powered by the shared product-filters engine. Runs fully client-side on a given dataset, self-fetches from your API via productsUrl with an SSR-friendly first page, or emits queries in controlled server mode.

PRO

productlist3

Marketplace Toolbar Product Grid

Dense product grid with an always-visible inline filter toolbar: search, a segmented category, a cascading subcategory select, and a searchable brand combobox, powered by the shared product-filters engine. Self-fetches from your API via productsUrl with an SSR-friendly first page, runs client-side on a dataset, or emits queries in controlled server mode.

PRO

productlist5

Load More Feed With Category Pills

Three-column product feed led by a row of category pills, with a search and sort, and a Load more button plus progress bar that appends the next batch instead of paginating, powered by the shared product-filters engine. Self-fetches from your API via productsUrl with an SSR-friendly first page, runs client-side on a dataset, or emits queries in controlled server mode.