Pro
Query builder
Build a filter from conditions and nested groups, typed by field: text, number, date, options and yes/no. It reads back as a sentence, counts matches live, flags unfinished conditions and saves segments.
pnpm dlx shadcn@latest add @caliper/query-builderWhen to use
Use it for
- Segments, audiences and saved filters.
- Admin search over many fields.
Skip it when
- Two or three filters; use filter chips.
Installation
pnpm dlx shadcn@latest add @caliper/query-builder
Adds its 7 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source. It is built from emptyQuery, ruleComplete, matchQuery, describeQuery and QueryBuilder.
import { emptyQuery, ruleComplete, matchQuery, describeQuery, QueryBuilder } from "@/components/ui/query-builder"
The worked example comes with Pro
The 70-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
emptyQuery
component
No props of its own; it re-exports a primitive and takes that primitive’s props.
ruleComplete
component
matchQuery
component
describeQuery
component
QueryBuilder
component
Accessibility
It exposes group semantics, with aria-labelledby, aria-label, aria-hidden, aria-pressed and aria-live kept in step with state. Changes that matter are announced through a live region.
Keyboard and focus handling comes from Radix popover: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- Record gridA spreadsheet-grade table for records: pin and resize columns, group with subtotals, totals in a sticky footer, edit cells in place with undo and redo, export what you see to CSV and save the arrangement as a view.
- Filter toolbarA search field and filter menus with result counts, for narrowing a list.
- Segmented control