Victor Mesquita

Filter Bar

Forms

About

A compound toolbar for displaying active filters as removable chips with a result count and a reset action, for list/table filtering UIs.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Filter Bar to your project and fits it to your theme.

Code

How Filter Bar is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import {
  FilterBar,
  FilterBarControls,
  FilterBarChips,
  FilterBarChip,
  FilterBarCount,
  FilterBarReset,
} from "@/components/ui/filter-bar";

export default function FilterBarDemo() {
  const [filters, setFilters] = React.useState([
    "Active",
    "In stock",
    "Under $50",
  ]);

  const removeFilter = (filter: string) => {
    setFilters((prev) => prev.filter((item) => item !== filter));
  };

  return (
    <div className="w-full max-w-xl p-6">
      <FilterBar activeCount={filters.length} onReset={() => setFilters([])}>
        <FilterBarControls>
          <FilterBarChips>
            {filters.map((filter) => (
              <FilterBarChip key={filter} onRemove={() => removeFilter(filter)}>
                {filter}
              </FilterBarChip>
            ))}
          </FilterBarChips>
        </FilterBarControls>
        <FilterBarCount>{filters.length} active</FilterBarCount>
        <FilterBarReset />
      </FilterBar>
    </div>
  );
}

Dependencies

More by Victor Mesquita

View all
  • Data Table Toolbar

    Data Table Toolbar

    10
  • Uai Blocks Community Feed

    Uai Blocks Community Feed

    5
  • Cart Drawer

    Cart Drawer

  • App Sidebar

    App Sidebar

  • Author Card

    Author Card

  • Contact Section

    Contact Section

  • Audit Log

    Audit Log

  • Task List

    Task List

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19