Component libraryQuery builder

Query builder

Pro

Build a controlled flat AND/OR rule set from consumer-defined fields, operators, and values.

npx shadcn@latest add @tidal-pro/query-builder
Desktop viewport

Installation

Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.

Terminal
npx shadcn@latest add @tidal-pro/query-builder

Import components/ui/tidal.css, components/ui/query-builder.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

Controlled flat builder accepts unique-ID field definitions for text, number, or enum values; field-owned operators; optional enum options; unique-ID controlled rules; and an AND/OR conjunction. onRulesChange receives the full proposed array, typed add/remove/field/operator/value change detail, and the native event so consumers can accept or decline. createRule supplies caller-owned IDs and defaults. Native fieldset props/ref, disabled state, description, per-rule errors, empty content, labels, caller-controlled result content, native conjunction/add props/refs, and per-rule native field/operator/value/remove props/refs are supported. Native value-input placeholder props override field-schema placeholders. Native controls are 44px, use ordinary Tab order, compose caller handlers first, recover focus after accepted add/remove only while the source still owns focus or an unmounted Remove leaves focus at body, and preserve exact string input values. Unknown fields/operators/enum values and duplicate rule IDs render linked errors without execution. Consumers own validation, serialization, persistence, data filtering, and every side effect; this component never runs a query.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.