mohammed-saif-ibrahim

Filter Builder

Forms

About

An interactive filter-condition builder with field, operator, and value rows joined by AND/OR logic, for search bars and data-table filtering UIs

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

Code

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

Usage.tsx

import * as React from "react";
import { FilterBuilder } from "@/components/ui/filter-builder";

export default function FilterBuilderDemo() {
  const [logic, setLogic] = React.useState("AND");
  const [conditions, setConditions] = React.useState([
    { id: "1", field: "status", operator: "eq", value: "Active" },
  ]);

  return (
    <div className="w-full max-w-xl p-6 bg-[var(--ui-bg)] text-[var(--ui-fg)]">
      <FilterBuilder
        fields={[
          { value: "name", label: "Name" },
          { value: "status", label: "Status" },
          { value: "role", label: "Role" },
        ]}
        conditions={conditions}
        onConditionsChange={setConditions}
        logic={logic}
        onLogicChange={setLogic}
      />
    </div>
  );
}

More by mohammed-saif-ibrahim

View all
  • Select

    Select

  • File Upload

    File Upload

  • Command Palette

    Command Palette

  • Checkbox

    Checkbox

  • Activity Feed

    Activity Feed

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 1

    Login 1

    52
  • Book A Demo 3

    Book A Demo 3

    83
  • Authentication Card

    Authentication Card

    47
  • Book A Demo 1

    Book A Demo 1

    69
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    32
  • Login 2

    Login 2

    7