November 2026 - Query Builder
A composable query builder for nested filter rules and groups, with parameterized SQL output.
Query Builder builds nested filter rules and groups, and turns them into parameterized SQL.
pnpm dlx shadcn@latest add @diceui/query-builderFeatures
- Composable parts. Build the layout from parts like
QueryBuilderGroup,QueryBuilderRuleListandQueryBuilderRule. Nested groups reuse the root group's layout. - Fields. Each field has a
value, alabeland atype: text, number, date, boolean, select or multi-select, each with its own operators. - Multiple values. Select fields switch from "is" to "is any of" when a second value is picked, like Linear's filters.
- Negated groups.
QueryBuilderNegateturns a group intoNOT (...). - Labels. Pass
labelsto reword or translate the built-in text.
Utilities
formatQueryturns a query into a parameterizedWHEREclause for Postgres, MySQL or SQLite.matchesQueryfilters rows in the browser with the same rules.moveQueryNodeandfindQueryNodemove and find rules and groups, for drag and drop.
Examples
The docs include SQL output, client-side filtering, a Linear-style command filter, and drag and drop with Sortable.