Vue / Vite
@movk/nuxt is not just a Nuxt module — it also provides a Vite plugin (@movk/nuxt/vite) and a Vue plugin (@movk/nuxt/vue-plugin), making standalone UI components, AutoForm / DataTable, theming and non-server-side composables available directly in plain Vue + Vite projects.
useApiFetch / useLazyApiFetch / useClientApiFetch, upload/download, $api plugin, auth and error toasts, etc.) — these depend on the Nuxt server runtime and are only available in Nuxt mode.Installation
Install Dependencies
Requires @nuxt/ui >=4.13.0.
pnpm add @movk/nuxt @nuxt/ui zod tailwindcss
npm install @movk/nuxt @nuxt/ui zod tailwindcss
yarn add @movk/nuxt @nuxt/ui zod tailwindcss
vue-router is enabled by default (controlled via the ui.router option). If using the default, also install vue-router:
pnpm add vue-router
npm install vue-router
Add the Vite Plugin
Register the movk() plugin in vite.config.ts:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import movk from '@movk/nuxt/vite'
export default defineConfig({
plugins: [
vue(),
movk()
]
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import movk from '@movk/nuxt/vite'
export default defineConfig({
plugins: [
vue(),
movk({
ui: {
router: 'inertia'
}
})
]
})
movk() internally registers unplugin-auto-import and unplugin-vue-components, which generate auto-imports.d.ts and components.d.ts. It is recommended to add them to .gitignore and include them in tsconfig.{
"include": ["src/**/*.ts", "src/**/*.vue", "auto-imports.d.ts", "components.d.ts"]
}
auto-imports.d.ts
components.d.ts
tsconfig for completions in vite.config.ts:{
"compilerOptions": {
"paths": {
"#build/movk-ui": ["./node_modules/.movk-ui/movk-ui"],
"#build/ui": ["./node_modules/.nuxt-ui/ui"]
}
}
}
Register the Vue Plugin
Register @movk/nuxt/vue-plugin in your entry file (it already links in @nuxt/ui/vue-plugin internally):
import './assets/css/main.css'
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import movk from '@movk/nuxt/vue-plugin'
import App from './App.vue'
const router = createRouter({
routes: [],
history: createWebHistory()
})
createApp(App)
.use(router)
.use(movk)
.mount('#app')
Import Styles
@import "tailwindcss";
@import "@movk/nuxt";
Wrap the Root Component with <UApp>
<UApp> provides the global context for Toast, Tooltip and imperative overlays; useMessageBox depends on it:
<template>
<UApp>
<RouterView />
</UApp>
</template>
class="isolate" to the root container (#app in index.html) to ensure proper style scoping and overlay stacking.Coexisting with UnoCSS / Existing Global Styles
When adding Movk to an existing project, a common problem is that the background, padding, border radius and other styles of Nuxt UI components have no effect. The cause is cascade layers: Tailwind utilities live in @layer utilities, and any unlayered style beats styles inside @layer, regardless of selector specificity. The preflight (reset) that UnoCSS outputs by default and a project's own global reset are both unlayered.
movk() prints a warning in the terminal when UnoCSS outputs an unlayered reset.Disable the UnoCSS Reset
@import "tailwindcss" already provides an equivalent reset in @layer base, so you can simply disable the UnoCSS reset:
import { defineConfig, presetWind4 } from 'unocss'
export default defineConfig({
presets: [
presetWind4({
preflights: { reset: false }
})
]
})
presetWind4 switch is preflights.reset. A top-level reset: false has no effect.Move the UnoCSS Preflight into the Base Layer
To keep the UnoCSS preflight, use outputToCssLayers to put it in Tailwind's base layer while utilities stay unlayered:
export default defineConfig({
outputToCssLayers: {
cssLayerName: layer => layer === 'preflights' ? 'base' : null
}
})
Move an Existing Global Reset into the Base Layer
Wrap the project's own reset in @layer base so it no longer overrides Nuxt UI utilities:
@layer base {
*,
::before,
::after {
margin: 0;
padding: 0;
}
}
Options
Pass options into movk() in vite.config.ts for configuration.
prefix Component Prefix
Component name prefix.
- Default:
M
movk({
prefix: 'M'
})
site Site Information
Site name, affects the localStorage key prefix for theme persistence (<name>-ui-*).
movk({
site: { name: 'my-app' }
})
theme Theme
theme.colors (color aliases), theme.defaultVariants (default variants), theme.prefix (aligned with the Tailwind prefix), etc. — mirrors the Nuxt mode movk.theme.
movk({
theme: {
defaultVariants: {
color: 'neutral',
size: 'sm'
}
}
})
icon Icons
icon.clientBundle controls whether the icons used by movk components and the built-in icon sets enter the build-time icon bundle, mirroring the Nuxt mode movk.icon. The icon data requires the matching @iconify-json/* packages in your project; collections that are not installed are skipped automatically (never a build failure). See Theme · Icon Sets.
movk({
icon: { clientBundle: false }
})
ui
ui is a passthrough for @nuxt/ui unplugin configuration (Partial<NuxtUIOptions>), hosting router, colorMode, autoImport, components, dts, icon, ui theme, etc. Movk automatically injects its own composables, component resolution and icons into ui.autoImport / ui.components / ui.icon.clientBundle.icons, so no manual configuration is needed.
Module Configuration
Configure component prefix, theme colors, fonts, API endpoints, auth strategy, response parsing rules and Toast notification behavior.
Theme System
Manage colors, radius, icon sets and dark mode through module defaults, the ThemePicker component and the useTheme composable, with build-time font configuration.