Skip to content

Getting started ​

@vuqs/nuxt installs the query adapter for Nuxt's router and registers the composables, codecs, and built-in module factories as auto-imports. Apps without pages are supported through Nuxt's minimal router.

Install ​

bash
pnpm add @vuqs/core @vuqs/nuxt

Register the module:

ts
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@vuqs/nuxt'],
})

Usage ​

vue
<script setup lang="ts">
const search = useQueryState('q', codecs.string.withDefault(''))
</script>

<template>
  <input v-model="search">
</template>

Writing to search updates the URL through the installed adapter. No per-component provider is required.

Next steps ​

Compatibility ​

The module declares support for Nuxt 3 and Nuxt 4 (nuxt: '>=3.0.0').

Released under the MIT License. Inspired by nuqs.