Install with shadcn
Add the coss ui query builder or any example to your project as source, with one command.
The site is a shadcn registry. shadcn add copies qnot's
coss ui query builder, or a whole example, into your project as source you own, installs the npm
packages it needs (@qnot/core, @qnot/react, lucide-react), and pulls the
coss ui components it uses from coss's own registry.
Before you start
Your project needs Tailwind CSS v4 and a components.json. If you don't use coss ui yet, set it up
first:
pnpm dlx shadcn@latest init @coss/styleFiles land under components/qnot/ (your components alias), and their imports are rewritten
to your aliases. Everything installed from this registry is MIT licensed.
The query builder
pnpm dlx shadcn@latest add https://coss.com/qnot/r/query-builder.json'use client';
import { createQueryStore, defineFields, f } from '@qnot/core';
import { useState } from 'react';
import { CossQueryBuilder } from '@/components/qnot/query-builder';
const fields = defineFields({ name: f.text(), age: f.number({ min: 0 }), plan: f.enum(['free', 'pro']) });
export function Filters() {
const [store] = useState(() => createQueryStore({ fields }));
return <CossQueryBuilder store={store} showLock />;
}Other UI kits
The builder also comes in shadcn/ui, MUI and plain-HTML variants, the ones on the
UI kits page. Each one installs query-builder-core, the kit-agnostic builder they share
(components/qnot/kits/shared), plus the kit's own controls:
| Item | Install into | Brings |
|---|---|---|
query-builder-shadcn | a Radix-based shadcn/ui project (pnpm dlx shadcn@latest init --base radix) | the shadcn/ui components it uses, in your project's style |
query-builder-mui | any React project | @mui/material, @mui/icons-material, Emotion |
query-builder-headless | any Tailwind project | nothing else: plain HTML to restyle |
pnpm dlx shadcn@latest add https://coss.com/qnot/r/query-builder-mui.json'use client';
import { createQueryStore } from '@qnot/core';
import { useState } from 'react';
import { QueryBuilder } from '@/components/qnot/kits/mui';
import { fields } from './fields';
export function Filters() {
const [store] = useState(() => createQueryStore({ fields }));
return <QueryBuilder store={store} />;
}query-builder-shadcn is written against the Radix-based shadcn/ui components. Projects using a
Base UI style ("style": "base-…" in components.json, which plain shadcn init can create) get
type errors; use the coss ui builder there, which is built on Base UI.
The coss ui builder (query-builder) and the shadcn/ui variant (query-builder-shadcn) both
install their components into components/ui, and their components share names (select,
button, tooltip…). Pick one of the two per project; mixing them overwrites one with the other.
An example
Every example is a registry block: the page shows its full source and the command to
install it. Each example exports a Demo component:
pnpm dlx shadcn@latest add https://coss.com/qnot/r/product-filters.jsonimport { Demo as ProductFilters } from '@/components/qnot/examples/product-filters';
export default function Page() {
return <ProductFilters />;
}Every item
| Item | What it is | Installs |
|---|---|---|
tip | A coss tooltip around any element, used by the qnot builder's actions. | components/qnot/tip.tsx |
query-builder | A complete qnot query builder made of coss ui components: typed fields, value/field/function operands, list conditions, locks, drag and drop, undo-ready. | components/qnot/query-builder.tsx components/qnot/controls.tsx |
query-builder-core | The kit-agnostic qnot builder: layout, editors and wiring over @qnot/react, rendered through a small Kit interface. The kit variants below plug their controls into it. | components/qnot/kits/shared/kit.ts components/qnot/kits/shared/builder.tsx components/qnot/kits/shared/draft.ts |
query-builder-shadcn | The qnot query builder made of shadcn/ui components, for Radix-based shadcn/ui projects. | components/qnot/kits/shadcn.tsx |
query-builder-mui | The qnot query builder made of Material UI components, with its own light/dark theme. | components/qnot/kits/mui.tsx |
query-builder-headless | The qnot query builder in plain HTML elements and Tailwind classes: the starting point for your own design system. | components/qnot/kits/headless.tsx |
code-block | A copyable code block in a content-sized coss scroll area, with optional lazy syntax highlighting (sql, json, typescript). | components/qnot/code-block.tsx components/qnot/scroll-box.tsx components/qnot/highlight.ts |
describe | Render a qnot query as a plain-English sentence with the text codec. | components/qnot/describe.ts |
example-utils | useExampleStore, useLiveQuery and a seeded random generator, shared by the qnot examples. | components/qnot/examples/shared.ts |
linear-filters | Inline filter chips: the same hooks, a completely different UI | components/qnot/examples/linear-filters.tsx |
workflow | “When a booking is created and …, then …” with a live event log | components/qnot/examples/workflow.tsx |
saved-views | Named views, dirty tracking, undo/redo, and queries as plain English | components/qnot/examples/saved-views.tsx |
product-filters | Faceted search over a catalogue, filtered client-side with compile() | components/qnot/examples/product-filters.tsx |
segments | Marketing segments with a live audience count and parameterized SQL | components/qnot/examples/segments.tsx |
feature-flags | Segment rules + percentage rollout, shipped to the edge as JsonLogic | components/qnot/examples/feature-flags.tsx |
alerting | Thresholds, ranges and field-vs-field checks over a live metric stream | components/qnot/examples/alerting.tsx |
access-policy | Allow-if rules with NOT-group denies, plus a request simulator | components/qnot/examples/access-policy.tsx |
rqb-dropin | Keep your saved RQB JSON: the store speaks its format via `format: rqb` | components/qnot/examples/rqb-dropin.tsx |
server-side | The same query as Postgres, MySQL, SQL Server, MongoDB and JsonLogic | components/qnot/examples/server-side.tsx |
Items depend on each other where they share code, so installing an example brings the builder and
helpers it uses. Running shadcn add again asks before overwriting files you've changed.