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.

Put view state in the URL ​

Search, filters, sort, and pagination all belong in the query string. vuqs binds them to typed, reactive refs: 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>

TIP

New here? Start with Installation, then read Concepts for codecs, params, schemas, and writes.

Released under the MIT License.