@unvuetify/nuxt-utils
v1.1.3
Published
Nuxt 3 utilities for Vuetify
Readme
📦 Install
# pnpm
pnpm add @unvuetify/nuxt-utils
# npm
npm i @unvuetify/nuxt-utils
# yarn
yarn add @unvuetify/nuxt-utils
# bun
bun add @unvuetify/nuxt-utils🦄 Usage
We suggest you to use vuetify-nuxt-module, there are a lot of options to configure Vuetify including SSR support and HTTP Client Hints.
If you just want to auto-import Vuetify components, composables and directives and use sass/scss variables in your Nuxt 3 app, you can use the configureVuetify in a new module, create the following module in your Nuxt modules folder:
// modules/vuetify.ts
import type { VuetifyNuxtOptions } from '@unvuetify/nuxt-utils'
import { defineNuxtModule } from '@nuxt/kit'
import { configureVuetify } from '@unvuetify/nuxt-utils'
export interface ModuleOptions extends VuetifyNuxtOptions {
}
export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'vuetify:nuxt-module',
configKey: 'vuetify',
compatibility: {
nuxt: '>=3.0.0',
},
default: {},
},
setup(options, nuxt) {
configureVuetify(nuxt, options)
},
})then, run the nuxt/nuxi prepare command and add the options to your nuxt.config.ts using the vuetify key:
// nuxt.config.ts
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
/* other nuxt options */
vuetify: {
composables: { /* composables options */ },
components: { /* components options */ },
directives: { /* directives options */ },
styles: { /* styles options */ }
}
})add vuetify/styles to the css option in your nuxt.config.ts file:
// nuxt.config.ts
css: [
'@mdi/font/css/materialdesignicons.css', // if you're using mdi icon fonts
'vuetify/styles'
]and finally, you also need to add a Nuxt plugin to register the Vuetify plugin:
// plugins/vuetify.ts
import { createVuetify } from 'vuetify'
export default defineNuxtPlugin((nuxtApp) => {
const vuetify = createVuetify({
theme: {
defaultTheme: 'dark',
},
})
nuxtApp.vueApp.use(vuetify)
})Check the nuxt playgrounds:
📄 License
MIT License © 2025-PRESENT Joaquín Sánchez
