ANTLR4-based filter query parser and React editor component for building advanced filter queries similar to Excel or Airtable filters. Current stable version 2.2.0. The library provides a React CodeMirror component with syntax highlighting, autocomplete, validation, formatting, and an evaluator for executing filter expressions. It ships TypeScript definitions and supports React 18 and 19. Key differentiators include a full ANTLR4 grammar for precise parsing, a separate parser/formatter/evaluator API that can be used independently of the React component, and support for complex expressions with parentheses, comparison operators, and string functions like 'contains' and 'starts with'. Release cadence is not strictly defined, but updates are focused on bug fixes and minor enhancements.
npm install filter-query-editorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
A minimal React component rendering the query editor with column definitions and state management.
Use `onChange={(e) => setQuery(e.text)}` instead of `onChange={setQuery}`If using Next.js, adjust CSS import configuration or import from a different path; refer to library documentation for bundler-specific setup.
Do not modify the bundled grammar files; if you need custom syntax, fork the library.
Ensure column names are enclosed in square brackets, e.g., `[price] > 100`.
Use `onChange={(e) => setQuery(e.text)}`.Check the package's actual CSS export path in node_modules; some bundlers require different import methods. Alternatively, import the CSS via a CDN or inline styles.