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
  • Task List

    Task List

    8
  • Uai Blocks Community Feed

    Uai Blocks Community Feed

    5
  • Reaction Bar

    Reaction Bar

    3
  • Cart Item

    Cart Item

  • Quantity Picker

    Quantity Picker

  • Comment

    Comment

  • Metric Card

    Metric Card

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    95
  • Premium Auth

    Premium Auth

    614
  • Onboarding Stepper

    Onboarding Stepper

    13
  • Authentication Card

    Authentication Card

    52