# Ecommerce Category Filter: Filter Drawer

A slide in drawer holding category, price, and rating filters for small screens. Keeps the product grid full width until shoppers tap to refine on mobile.

- Page: https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-filters/filter-drawer
- 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-drawer.png

## Install

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

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-drawer.json"`.

## Depends on

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

## About this block

Filter Drawer is a compact filter trigger bar. A single outlined button
labelled "Filters" sits in the top left of the bar; when active filters are
applied a numeric badge appears on the button showing the count. Tapping the
button opens a bottom drawer. Inside the drawer a scrollable accordion
presents six collapsible sections in order: Categories (checkboxes), Price
Range (a dual-handle slider with live dollar labels), Brands (checkboxes),
Colors (a four-column grid of circular swatches with a check mark overlay),
Sizes (a three-column grid of toggle buttons), and Rating (star icon rows
with checkboxes). A sticky footer holds a "Clear all" button and an "Apply
filters" button that closes the drawer.

Below the trigger bar, active selections render as dismissible outline
badges. Each badge shows the filter value and an X button to remove it
individually, with a "Clear all" shortcut at the end of the row. All six
filter dimensions are independent, so you can remove or reorder accordion
sections, swap the category or brand lists, or adjust the price ceiling
without affecting the rest.

## When to use

Reach for this block on a listing page where the product grid should fill
the full viewport width by default. It suits a logistics or delivery
platform that needs to let dispatchers or customers narrow a large catalog
of shipment services, packaging sizes, or carrier options on a small screen
without pushing a sidebar into view on every load. Compared to the sidebar
layout, it costs zero horizontal space at rest; compared to the horizontal
chip row, it handles many more filter dimensions without crowding the
toolbar.

A natural flow around it on an Ecommerce page:

**Before**

- [Category Preview](https://www.shadcn-ui-blocks.com/blocks/ecommerce/category-preview) to let shoppers
  orient before they reach the listing
- [Promo Sections](https://www.shadcn-ui-blocks.com/blocks/ecommerce/promo-sections) for a banner or deal
  strip that sits above the grid

**After**

- [Product List](https://www.shadcn-ui-blocks.com/blocks/ecommerce/product-list) as the grid that receives
  the filtered results
- [Customer Reviews](https://www.shadcn-ui-blocks.com/blocks/ecommerce/ecommerce-customer-reviews) to
  reinforce trust once shoppers narrow to a shortlist

## What you can customize

The drawer holds six accordion sections that each control a distinct filter
dimension. A few common ways to adapt them:

- **Filter sections.** Add, remove, or reorder accordion items to match
  your own taxonomy; the active badge strip and count update automatically
  for whichever sections remain.
- **Price ceiling.** Change the slider max and step to suit your catalog,
  whether that is parcel weights, delivery fees, or retail prices.
- **Color and size grids.** Replace the demo swatches and size codes with
  your own values; the circular swatch pattern and the toggle button grid
  each accept any list without layout changes.

> Tip: keep the accordion sections to five or fewer so the drawer content
> fits in one viewport height and shoppers rarely need to scroll inside it.

## More in Ecommerce Category Filters

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