# Ecommerce Category Filter: Filter Demo

A sidebar of category filters with checkboxes, price sliders, and color swatches beside a product grid. Refines large catalogs on a shop listing page.

- Page: https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-filters/filter-demo
- Collection: [Ecommerce](https://www.shadcn-ui-blocks.com/blocks/ecommerce), Free tier
- Group: [Category Filters](https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-filters)
- Created: 2026-06-14
- Preview image: https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-filters/filter-demo.png

## Install

```bash
npx shadcn@latest add @shadcn-ui-blocks/ecommerce-category-filters-filter-demo
```

A free block: it installs with no account or key. Or install it by URL: `npx shadcn@latest add "https://www.shadcn-ui-blocks.com/r/ecommerce-category-filters-filter-demo.json"`.

## Depends on

- npm packages: class-variance-authority, lucide-react, radix-ui
- shadcn/ui components: badge, button, checkbox, collapsible, scroll-area, separator
- Installs to: `@/components/blocks/ecommerce/category-filters/filter-demo`

## About this block

Filter Demo is a two-column shop layout. A fixed-width sidebar on the left
holds five collapsible filter sections: Categories, Brands, Colors, Sizes,
and Rating. Each section can be expanded or collapsed individually. Categories
and Brands use checkbox lists, Colors renders a grid of circular swatches with
a check mark on selection, Sizes uses toggle buttons, and Rating shows star
rows that match a minimum threshold. The right column is a responsive product
grid showing cards with an image, name, category, star rating, price (with
a strikethrough original when on sale), and an Add to Cart button. A live
count above the grid updates as filters are applied, and an empty state
message appears when no products match.

On small screens the sidebar is hidden and replaced by a "Filters" button
that opens a slide-in overlay panel with the same filter sections, plus
Apply and Clear actions at the bottom. The active filter count badge on the
button tells shoppers how many constraints are in play. The product grid,
the sidebar sections, and the product data are all independent, so you can
add or remove filter groups, swap the catalog items, and adjust the grid
column count without touching unrelated parts of the block.

## When to use

This layout suits any catalog page where shoppers arrive with a clear intent
and need to narrow a mid-to-large product set quickly. For an AI assistant
product marketplace it works especially well on a plans or add-ons listing
where buyers filter by capability category, compatible platform, price tier,
and aggregate rating before committing. The persistent sidebar keeps the
active constraints visible at all times, which is an advantage over the
[Horizontal Filters](https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-filters/horizontal-filters)
layout when you have five or more distinct filter dimensions.

A natural flow around it on an Ecommerce page:

**Before**

- A [Category Preview](https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-preview) to let shoppers
  pick a top-level segment before landing on the filtered grid
- A short hero or page heading to set context for the listing

**After**

- A [Bundle Upsells](https://www.shadcn-ui-blocks.com/blocks/ecommerce/ecommerce-bundle-upsells) section
  to surface complementary add-ons after shoppers have narrowed their choice
- A [Customer Reviews](https://www.shadcn-ui-blocks.com/blocks/ecommerce/ecommerce-customer-reviews) block
  to reinforce purchase confidence below the grid

## What you can customize

Replace the demo catalog and filter lists with your own data, then decide
which sections to keep:

- **Filter sections.** Each collapsible group is independent. Add a new
  dimension such as license type or subscription tier by following the
  same checkbox pattern, or remove any section that does not apply to
  your catalog.
- **Product cards.** The card renders name, category, rating, price, and
  a sale badge automatically when the original price exceeds the current
  price. Swap in your own fields or remove the wishlist button if your
  store does not use saved items.
- **Mobile overlay.** The slide-in panel inherits all desktop filter
  sections automatically. If your filter set is short you can simplify
  the overlay footer by removing the separate Apply button and letting
  selections take effect immediately.

> Tip: keep the Categories and Brands lists short enough to avoid scrolling
> inside the sidebar; seven or fewer options per section keeps the panel
> readable without needing an inner scroll area.

## More in Ecommerce Category Filters

- [Filter Drawer](https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-filters/filter-drawer)
- [Horizontal Filters](https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-filters/horizontal-filters)
