React Query Builder is a React component for building filter rules visually, with utilities to import and export SQL, MongoDB, and other query formats. Optional packages add drag-and-drop, datetime fields, and UI library themes.
Overview
React Query Builder provides a main QueryBuilder React component plus helper functions to translate rule trees into SQL, MongoDB, CEL, JsonLogic, and other query languages shown in the live demo. Teams import the component and default stylesheet, then configure fields, operators, and combinators for their domain.
The core package is customizable at the field and operator level. Separate npm packages add drag-and-drop reordering, richer date and time inputs, expression syntax in rules, and if-then-else rules engine behavior. Maintainers also ship compatibility packages that skin the builder for Ant Design, Bootstrap, Bulma, Chakra UI, Fluent UI, Mantine, MUI, PrimeReact, Tremor, and a React Native variant.
Query object format is shared with official ports to other UI frameworks via @react-querybuilder/core, so import and export utilities behave consistently across ecosystems. Documentation and example projects cover migration from earlier react-querybuilder releases and from react-awesome-query-builder.
The component was influenced by the earlier jQuery QueryBuilder project while aiming for full React-centric composition and export flexibility.
Key features
- Visual rule and group builder UI
- SQL and MongoDB export utilities
- CEL and JsonLogic support
- Optional drag-and-drop package
- Datetime and expression add-ons
- UI library compatibility packages
- React Native component variant
- Shared core across framework ports
Use cases
- Admin filter builders in web apps
- Dynamic search form UIs
- Rule editors exporting to SQL
- MongoDB filter construction
- Styled builders with design systems