Skip to content
项目

关于

Intuitive query builder for React – add advanced filtering to your app

网站与应用开发

这些数字如何统计

可以做什么

  • Complex filter queries: multi-field rules, groups of filters, nested filters, AND/OR logic.
  • Multiple data types: text, number, and date filtering with type-specific operators.
  • AI-powered natural language filtering: convert conversational queries into structured filters.
  • Query syntax with autocomplete: real-time syntax highlighting, field and value suggestions, and validation.

实测星标增长

24小时
正在收集历史
7天
正在收集历史
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

SVAR React Filter | Query Builder

npm License npm downloads

SVAR React Filter is a library of four React components that help you add flexible filtering features to your apps: from simple filter bars to advanced query builders. It provides an intuitive UI for creating and editing filtering rules, grouping filters, defining conditions, and choosing the logic (AND/OR).

SVAR Filter - React Query Builder Component

:jigsaw: Included Components

SVAR React Filter library includes the following components:

  • FilterBuilder - the main component that provides an interactive interface for building complex queries and filtering large datasets.
  • FilterEditor - allows you to create a filtering rule for a single field, and can be used as a standalone component.
  • FilterBar - a simplified filter bar UI with inputs and select controls. It allows building filtering rules for several fields and combining them with logical operators. Can be used above data tables or dashboards.
  • FilterQuery - a YouTrack-style search input that accepts structured queries (Status: Open and Age: >30), natural language (show all users older than 30), or both in mixed mode.

:sparkles: Key features:

  • Complex filter queries: multi-field rules, groups of filters, nested filters, AND/OR logic.
  • Multiple data types: text, number, and date filtering with type-specific operators.
  • AI-powered natural language filtering: convert conversational queries into structured filters.
  • Query syntax with autocomplete: real-time syntax highlighting, field and value suggestions, and validation.
  • Configurable layouts: vertical, horizontal, or minimal filter bar layouts.
  • Localization: labels and date formats can be customized to match users' locale.
  • Dynamic loading: filter options can be loaded on demand when a new filter is added.
  • JSON output: the component outputs structured JSON that can be transformed into SQL or other query formats.
  • Intuitive, straightforward API: easily set and retrieve values, customize filters, and track changes.
  • Full TypeScript support and compatibility with React 18 and 19.

Check out the demos to see all SVAR React Filter features in action.

:hammer_and_wrench: How to Use

To start using the components from the Filter package, simply import the package and include the desired component in your React file:

import { FilterBuilder } from "@svar-ui/react-filter";
import "@svar-ui/react-filter/all.css";

const fields = [
    {
        id: "first_name",
        label: "First Name",
        type: "text",
    },
    {
        id: "last_name",
        label: "Last Name",
        type: "text",
    },
];
const myComponent => (<FilterBuilder fields={fields} />);

See the getting started guide to quickly set up and begin using SVAR Filter components in your React projects.

:speech_balloon: Need Help?

Post an Issue or use our community forum.

探索相关项目

加载中…