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.jsonNo setup beyond Tailwind CSS and a components.json: plain HTML elements styled with Tailwind classes.
Source
4 files, exactly what installsUse it.
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.
- Source you ownshadcn add
The builder lands in components/qnot as plain TSX. Change any control; nothing is hidden in a package.
- Typed schemadefineFields
Fields declare their editors: text, number, enum, multi-select, dates, booleans, lists and objects.
- Export anywhereSQL · Mongo · JsonLogic
The store holds plain JSON. Encode it to parameterized SQL, MongoDB, JsonLogic, Elasticsearch or SpEL.
- Undo, drag and drophistory · dnd
Every edit is a step. Drag rules and groups by the handle; locks and limits are respected.
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.