npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@react-querybuilder/vue

v0.2.0

Published

Vue component for complex query building

Readme

@react-querybuilder/vue

Vue 3 component for complex query building. A port of React Query Builder built on @react-querybuilder/core, producing byte-identical DOM output.

Package name is temporary. The intended name is vue-querybuilder, but npm's automated checks currently reject it as too similar to the existing vue-query-builder. The package ships as @react-querybuilder/vue until that name is available.

Installation

npm install @react-querybuilder/vue

vue@^3.5 is a peer dependency. @react-querybuilder/core is a regular dependency and is re-exported in full, so you never need to depend on it directly.

Quick start

<script setup lang="ts">
import { ref } from 'vue';
import { formatQuery, QueryBuilder, type Field, type RuleGroupType } from '@react-querybuilder/vue';
import '@react-querybuilder/vue/dist/query-builder.css';

const fields: Field[] = [
  { name: 'firstName', label: 'First Name' },
  { name: 'lastName', label: 'Last Name' },
  { name: 'age', label: 'Age', inputType: 'number' },
];

const query = ref<RuleGroupType>({
  combinator: 'and',
  rules: [{ field: 'firstName', operator: 'beginsWith', value: 'Stev' }],
});
</script>

<template>
  <QueryBuilder v-model:query="query" :fields="fields" />
  <pre>{{ formatQuery(query, 'sql') }}</pre>
</template>

Driving the query

| Approach | Use when | | ----------------------------- | ------------------------------------------------------- | | :default-query | Uncontrolled; the component owns the query. | | v-model:query | Idiomatic two-way binding. Preferred. | | :query + :on-query-change | Explicit controlled mode. | | :manager | External control via a QueryManager instance you own. |

v-model:query is sugar for :query plus @update:query. onQueryChange is a callback prop, not an emit, and fires immediately before update:query; the two can be used together.

Veto callbacks — onAddRule, onAddGroup, onRemove, onMoveRule, onMoveGroup, onGroupRule, onGroupGroup — are callback props rather than emits, because a Vue emit cannot return a value and these must be able to cancel or rewrite the pending change.

External control:

<script setup lang="ts">
import { QueryManager, QueryBuilder } from '@react-querybuilder/vue';

const manager = new QueryManager({ combinator: 'and', rules: [] }, { history: true });
const undo = () => manager.undo();
</script>

<template>
  <QueryBuilder :manager="manager" :fields="fields" />
  <button @click="undo">Undo</button>
</template>

Styling

Two prebuilt stylesheets ship in dist: query-builder.css (full) and query-builder-layout.css (structural only). Both are byte-identical to @react-querybuilder/core's. The .scss sources are published alongside them for @use ... with (...) overrides. See Styling.

Documentation

Examples

  • examples/demo — Vite + Vue. Seven field types, standard and independent-combinator queries, every display flag, undo/redo, and live formatQuery output. Aliases the library source, so it hot-reloads with no build step.

    bun install && bun --filter @vue-querybuilder/example-demo dev
  • examples/nuxt — Nuxt 4, server-side rendering. Consumes the built dist as a workspace dependency and doubles as the project's SSR gate (ssr-smoke-test.ts, run by bun run test:ssr).

    bun install && bun run build && bun --filter @vue-querybuilder/example-nuxt dev

Non-goals

Drag and drop, UI-framework compatibility packages, expr/datetime UI, async option lists, a Redux store, and deprecated-prop fallbacks are all out of scope for v1.

License

MIT