Back to blocks
BlockeCommerceFree

Horizontal Filter Bar React component

A sticky filter bar above a product grid: dropdown pills for category (with live counts), price range with presets, colour swatches and rating, one-tap On sale and In stock toggles, a sort menu, removable active-filter chips with clear all, and a grid that reflows with animation; scrolls sideways on phones.

About the Horizontal Filter Bar component

Horizontal Filter Bar puts a store's filters in one row above the products instead of a sidebar, which leaves the full width for the grid. Each filter is a pill that opens a small panel: categories with counts, a price range, colour swatches and a minimum rating, plus On sale and In stock toggles and a sort menu.

Choices show up straight away as removable chips under the bar, the pills fill in with a count when they're active, and the grid reflows with a short animation. The bar sticks to the top while scrolling, and on phones it scrolls sideways.

When to use it

Use it for catalogues with a handful of filters where a sidebar would waste space, such as small to mid-size stores, collection pages and search results.

With many filter groups (ten or more), a sidebar or a full-screen filter modal on phones is easier to scan.

Installation

Add the Horizontal Filter Bar component to your project with the shadcn CLI. It lands in components/horizontal-filter-bar.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/horizontal-filter-bar

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

More eCommerce components

Mobile Filter Modal
Free
Order Confirmation Block
Free
Gift Card Designer
Free
Accordion Checkout
Free
Rating Summary Breakdown
Free
Multi-step Checkout Block
Free