docs(installation): update instructions for inertia (#3964)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2025-04-23 17:36:06 +02:00
committed by GitHub
parent 75e4792f7f
commit 975331a7b1

View File

@@ -99,6 +99,10 @@ app.use(ui)
app.mount('#app')
```
::note{to="#inertia"}
If you're using [Inertia.js](https://inertiajs.com/), you can skip the `vue-router` setup as Inertia provides its own routing system.
::
#### Import Tailwind CSS and Nuxt UI in your CSS
```css [assets/main.css]
@@ -313,6 +317,29 @@ export default defineConfig({
This option adds the `transition-colors` class on components with hover or active states.
::
### `inertia`
Use the `inertia` option to enable compatibility with [Inertia.js](https://inertiajs.com/).
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
inertia: true
})
]
})
```
::note
When using this option, `vue-router` is not required as Inertia.js provides its own routing system. The components that would normally use `RouterLink` will automatically use Inertia's `InertiaLink` component instead.
::
## Continuous Releases
Nuxt UI uses [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) for continuous preview releases, providing developers with instant access to the latest features and bug fixes without waiting for official releases.