Headless query builder

Typed hooks over a fast store, and a complete builder in plain HTML and Tailwind to start from. Swap in your design system one control at a time.

MIT · headless · native HTML · Tailwind

licenseMIT
markupNative HTML
stylingTailwind classes
installOne shadcn add

The headless builder that shadcn add installs, live on this page. Edit a rule and watch the exports.

Install it

One command copies the headless builder and the kit-agnostic core it shares with the other kits into components/qnot, and installs @qnot/core and @qnot/react. MIT licensed.

pnpm dlx shadcn@latest add https://coss.com/qnot/r/query-builder-headless.json

No setup beyond Tailwind CSS and a components.json: plain HTML elements styled with Tailwind classes.

Source

4 files, exactly what installs

Use it.

Describe your fields, create a store, render the builder. The store's onChange hands you the query.
fields.ts
Filters.tsx

kits/headless.tsx is the whole look: each control is a few lines of markup implementing a small Kit interface. kits/shared/builder.tsx turns @qnot/react's hooks into the builder around them. Replace a control with your design system's component and the rest keeps working.

The shadcn/ui and MUI kits are the same Kit interface filled in with other components; read them side by side to see how little changes.

What you get.

The kit is only the controls. Everything else comes from the qnot store underneath.

Questions people ask

What does headless mean here?
The state, rules, validation, undo and drag and drop live in a store and a set of hooks with no markup of their own. This kit is a complete builder written in plain HTML elements and Tailwind classes on top of them: the smallest working example to replace piece by piece.
Do I need Tailwind?
The installed file is styled with Tailwind classes. Without Tailwind, replace the class strings with your own CSS; the markup is plain <select>, <input>, <button> and <details>.
Can I skip the kit and start from the hooks?
Yes. A custom builder is a group component that renders its children by id, and a rule component, both reading the store through useGroup and useRule. The custom UI guide builds one step by step.Custom UI guide
Is it only for React?
This file is React. Vue, Svelte and Solid have the same hooks as composables and primitives, and @qnot/dom has binding helpers for plain DOM, so the same approach works in each.Vue Svelte Solid
Is it accessible?
It starts from native elements: <select> for pickers, <input> for values, <button> for actions and <details> for the add menu. They bring keyboard support and screen-reader semantics without extra libraries; check the result against your own requirements as you restyle.
Is it free?
Yes. MIT licensed, no API key, no account.