Nuxe wires up unplugin-auto-import and unplugin-vue-components as part of the framework’s Vite plugin stack. The result is that any component you drop intoDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dvlkit/nuxe/llms.txt
Use this file to discover all available pages before exploring further.
app/components/ becomes globally available in templates, and any composable you export from app/composables/ can be called in <script setup> blocks — with no import statement required in either case.
Component auto-imports
Every.vue file inside app/components/ is registered as a global component. The component name is derived from the filename (PascalCase). Nested directories act as a namespace prefix joined to the component name — this is controlled by the directoryAsNamespace: true option in unplugin-vue-components.
| File | Component name |
|---|---|
app/components/hello.vue | <Hello /> |
app/components/forms/input.vue | <FormsInput /> |
hello.vue component being used in pages/index.vue — no import required:
app/pages/index.vue
<Hello /> (from components/hello.vue) and <FormsInput /> (from components/forms/input.vue) are resolved automatically. The underlying component definitions:
Composable auto-imports
Any.ts or .js file you place in app/composables/ is scanned for named exports, and those exports become available everywhere in your app without an import. This mirrors how framework composables work: you just call them.
Here is a minimal example of a use-now composable and how a page would consume it:
Explicit
import statements inside .ts composable files (outside of <script setup>) are still required for Vue APIs like ref and onMounted. Auto-imports apply to <script setup> blocks in .vue files and to the auto-import dirs — not to arbitrary .ts modules.Framework composables
In addition to your own composables, the following symbols from@dvlkit/nuxe and related packages are auto-imported globally. You can use all of them in any <script setup> block without writing a single import line:
Vue core
All Vue 3 reactivity and lifecycle APIs (
ref, computed, watch, onMounted, etc.)Vue Router
useRoute, useRouter, onBeforeRouteLeave, onBeforeRouteUpdateData fetching
useAsyncData, useFetch, $fetch, createFetchPage utilities
definePage, useHead, navigateTo, abortNavigationError handling
createError, showError, useError, clearErrorRuntime
useRuntimeConfig, useState, useCookie, useRequestEvent, useRequestHeaders, useRequestURL, useRequestFetchPlugins
defineNuxePlugin, defineNuxeRouteMiddlewareComponents
ClientOnly component — renders only after hydrationuseHead is available in any page with no import:
app/pages/about.vue
TypeScript support
Nuxe writes two declaration files into.nuxe/ so TypeScript understands every auto-imported symbol:
| File | What it declares |
|---|---|
.nuxe/auto-imports.d.ts | Ambient type declarations for all auto-imported composables and utilities |
.nuxe/components.d.ts | Global component type declarations for every file in app/components/ |
nuxe dev or nuxe build. You should add .nuxe/ to your tsconfig.json’s include array (Nuxe projects do this by default) to get full IntelliSense on auto-imported symbols.
Manual imports still work perfectly. If you prefer explicit imports — or need to import something from a package that is not auto-imported — just write the
import statement as usual. Auto-imports never override an explicit import you have already written, and they never prevent you from importing the same symbol manually elsewhere.