Skip to content

vuqsType-safe query state for Vue.

The URL is the single source of truth for view state. Typed, reactive, and bound to your router.

Your state already lives in the URL

Search, filters, sort, and pagination belong in the query string, where a shared link restores the exact view. vuqs makes that state typed and reactive: you read values back as the types you declared, and write them like any ref.

vue
<script setup lang="ts">
import { codecs, useQueryState } from '@vuqs/core'

const search = useQueryState('q', codecs.string.withDefault(''))
const page = useQueryState('page', codecs.integer.withDefault(1))
</script>

<template>
  <input v-model="search" placeholder="Search…">
  <button @click="page++">Next page</button>
  <p>Searching “{{ search }}” on page {{ page }}</p>
</template>

Assigning a param writes the URL; the URL writes it back.

TIP

New here? Start with Installation, then read Concepts for the mental model.

Released under the MIT License.