Vue query builder
MIT · Vue 3.5+ · v-model · TypeScript
@qnot/vue, default builder, live on this page. Edit a rule and watch the exports.
pnpm add @qnot/core @qnot/vueA Vue query builder in two files.
For more control, create the store with useQueryStore and share it with provideQueryStore. The composables mirror the React hooks: useRule(id), useGroup(id), useQuery(), useHistory(), useIsValid(). They return shallowRefs fed by the store's per-node subscriptions rather than deep reactivity, so editing one rule updates only that rule's component.
The default builder takes components and labels to swap pieces and strings. See the Vue guide.
What you get.
- Typed schemadefineFields · QueryOf
Declare fields once. Rule values narrow by field and operator, and validated queries come back typed.
- Export anywhereSQL · Mongo · JsonLogic
Parameterized SQL in five dialects, MongoDB, JsonLogic, Elasticsearch, SpEL and plain English.
- Validationissues
Per-rule issues from the schema: required, min/max, patterns, options and your own checks.
- Undo and redohistory
Every edit is a step, typing merges into one. The demo above has the buttons wired up.
- Drag and dropdnd
Move rules and groups anywhere. The Vue binding ships the drag handle and drop target helpers.
- Any languagelabels · messages
Every UI string and validation message is an override away. No i18n library required.
- Same query on the servervalidate · compile
Share fields.ts with your API. Validate the query, then run it as bound SQL or filter rows in memory.
- Fast at 1,000 rulesper-node subscriptions
Editing one rule updates one rule. A keystroke costs the same at ten rules or a thousand.
How it compares.
Questions people ask
- Is it free?
- Yes. @qnot/vue and @qnot/core are MIT licensed. There is no license key, no trial banner and no per-developer pricing, which sets it apart from the commercial Vue query builders.
- Which Vue versions are supported?
- Vue 3.5 and later. The components are written with h(), so the package needs no SFC compiler and works in any Vue 3 build setup.
- Does it work with Nuxt?
- Yes. The default builder renders to HTML with Vue's server renderer (we checked it with renderToString), and node ids are sequential per store, so server and client agree. If you only need it in the browser, wrap it in <ClientOnly>. Server routes can import the same fields.ts to validate the query and turn it into SQL.Server usage
- Does it support v-model?
- Yes. QueryBuilder emits update:modelValue and change, so v-model works. You can also pass a store you created with useQueryStore and share it with provideQueryStore.
- Can I build my own UI instead of the default one?
- Yes. The composables (useRule, useGroup, useNode, useQuery, useHistory and the drag helpers) return shallowRefs and computeds fed by per-node subscriptions. Pass components to replace single pieces of the default builder, or write your own from scratch.Vue guide
- How does it compare with Syncfusion or DevExtreme?
- Both are commercial suites with Vue wrappers, many more components and paid support. qnot is one free library focused on the query builder, with typed values and more export formats. In our benchmark its framework-free build renders 1,000 rules faster than the JavaScript builds of both; the Vue binding uses the same store but was not measured on its own.vs Syncfusion vs DevExtreme