# Install with Nuxt

Add the Diorama module to Nuxt and start the app in a client plugin.

The Nuxt module adds the Vite plugin with the effects folder under `srcDir`, which is `app/effects/` in Nuxt 4.

## Install the packages

### npm

```sh
npm install @dioramajs/diorama three
```

### pnpm

```sh
pnpm add @dioramajs/diorama three
```

### yarn

```sh
yarn add @dioramajs/diorama three
```

### bun

```sh
bun add @dioramajs/diorama three
```

## Add the module

```ts title="nuxt.config.ts"
export default defineNuxtConfig({ modules: ['@dioramajs/diorama/nuxt'] })
```

## Start the app in a client plugin

A plugin whose name ends in `.client.ts` runs in the browser only.

```ts title="app/plugins/diorama.client.ts"
import { start } from '@dioramajs/diorama'

export default defineNuxtPlugin(() => {
  start()
})
```

## Put an effect on an image

```vue title="app/app.vue"
<template>
  <img
    src="/cover.jpg"
    width="800"
    height="450"
    data-dio="ripple"
  />
</template>
```

`<NuxtPage>` without a page transition swaps pages in one render, so keyed elements fly between pages without more code.
