---
title: "Configuration"
description: "The module options and the app-wide settings."
canonical_url: "https://nanimejs.netlify.app/guides/configuration"
---
# Configuration

> The module options and the app-wide settings.

Everything on this page is optional. Module options go in `nuxt.config.ts`.
App-wide settings go under the `nanime` key in `app.config.ts`.
[Defaults](https://nanimejs.netlify.app/guides/defaults) covers default props and parameters.

## Set module options

<table>
<thead>
  <tr>
    <th align="left">
      Option
    </th>
    
    <th align="left">
      Type
    </th>
    
    <th align="left">
      Default
    </th>
    
    <th align="left">
      What it does
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td align="left">
      <code>
        composables
      </code>
    </td>
    
    <td align="left">
      <code>
        boolean
      </code>
    </td>
    
    <td align="left">
      <code>
        true
      </code>
    </td>
    
    <td align="left">
      Auto-imports the composables and <code>
        provideAnimeDefaults()
      </code>
      
      . With <code>
        false
      </code>
      
      , import them from <code>
        #nanime/composables
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        components
      </code>
    </td>
    
    <td align="left">
      <code>
        boolean
      </code>
    </td>
    
    <td align="left">
      <code>
        true
      </code>
    </td>
    
    <td align="left">
      Registers <code>
        <AnimeTransition>
      </code>
      
      , <code>
        <AnimeTransitionGroup>
      </code>
      
       and <code>
        <AnimeLayoutGroup>
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        rebuild
      </code>
    </td>
    
    <td align="left">
      <code>
        'restart'
      </code>
      
      , <code>
        'keepTime'
      </code>
      
       or <code>
        'keepValue'
      </code>
    </td>
    
    <td align="left">
      <code>
        'restart'
      </code>
    </td>
    
    <td align="left">
      How <code>
        useAnimate
      </code>
      
      , <code>
        useAnimeTimeline
      </code>
      
       and <code>
        useScrambleText
      </code>
      
       rebuild. <code>
        'keepTime'
      </code>
      
       continues from the playhead. <code>
        'keepValue'
      </code>
      
       starts from the current values and applies to <code>
        useAnimate
      </code>
      
       only.
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        reducedMotion
      </code>
    </td>
    
    <td align="left">
      <code>
        'never'
      </code>
      
      , <code>
        'system'
      </code>
      
       or <code>
        'always'
      </code>
    </td>
    
    <td align="left">
      <code>
        'never'
      </code>
    </td>
    
    <td align="left">
      When <code>
        nanime
      </code>
      
       animations jump to their end state. <code>
        'system'
      </code>
      
       follows the visitor's <code>
        prefers-reduced-motion
      </code>
      
       setting. See <a href="https://nanimejs.netlify.app/guides/accessibility">
        Accessibility
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        aliases
      </code>
    </td>
    
    <td align="left">
      <code>
        boolean
      </code>
      
      , <code>
        string
      </code>
      
       or <code className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style="">
        <span class="sMK4o">
          {
        </span>
        
        <span class="sTEyZ">
          [composable]
        </span>
        
        <span class="sMK4o">
          :
        </span>
        
        <span class="sBMFI">
          string
        </span>
        
        <span class="sMK4o">
          }
        </span>
      </code>
    </td>
    
    <td align="left">
      <code>
        false
      </code>
    </td>
    
    <td align="left">
      New auto-import names for <code>
        nanime
      </code>
      
       composables whose name another auto-import also uses. See <a href="#fix-auto-import-name-clashes">
        Fix auto-import name clashes
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

`rebuild` replaces the 0.3 `keepTime` option. The
[changelog](https://nanimejs.netlify.app/changes/changelog) has the replacement for each use.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  modules: ['nanime'],
  nanime: {
    rebuild: 'keepTime',
    reducedMotion: 'system',
  },
})
```

The `rebuild` and `reducedMotion` options are also copied to
`runtimeConfig.public.nanime`. That lets an environment variable such as
`NUXT_PUBLIC_NANIME_REDUCED_MOTION=always` override them at deploy time.

## Fix auto-import name clashes

Rename `nanime` composables when another auto-import uses the same name.
With `@vueuse/nuxt` installed, the build logs this warning:

```txt
[nanime] WARN Other auto-imports use the same names as nanime composables:
  - useAnimate is also auto-imported from @vueuse/core. The app gets nanime's. aliases: true renames nanime's to useAnimeAnimate.
  - useDraggable is also auto-imported from @vueuse/core. The app gets nanime's. aliases: true renames nanime's to useAnimeDraggable.
Set nanime.aliases to rename them, or import the one you need explicitly.
```

The build also warns about clashes with other modules, presets and files
in your `composables/` folder. With `aliases` set, each clashing `nanime`
composable gets a new name. The other auto-import keeps the plain one.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  modules: ['@vueuse/nuxt', 'nanime'],
  nanime: {
    aliases: true,
  },
})
```

<table>
<thead>
  <tr>
    <th align="left">
      <code>
        aliases
      </code>
    </th>
    
    <th align="left">
      <code>
        nanime
      </code>
      
      's <code>
        useDraggable
      </code>
      
       is auto-imported as
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td align="left">
      <code>
        false
      </code>
    </td>
    
    <td align="left">
      <code>
        useDraggable
      </code>
      
      , and the warning lists it
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        true
      </code>
    </td>
    
    <td align="left">
      <code>
        useAnimeDraggable
      </code>
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        'motion'
      </code>
    </td>
    
    <td align="left">
      <code>
        useMotionDraggable
      </code>
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        { useDraggable: 'useDrag' }
      </code>
    </td>
    
    <td align="left">
      <code>
        useDrag
      </code>
    </td>
  </tr>
</tbody>
</table>

An object renames only the composables it lists. A clashing composable it
leaves out keeps its plain name and stays in the warning.

<note>

When a file in your `composables/` folder exports the same name as a
`nanime` composable, the `nanime` export wins. Your file's export is not
auto-imported under that name. Nuxt gives the app's composables a lower
auto-import priority than module composables.

</note>

## Set app-wide options

Put app-wide options under the `nanime` key in `app.config.ts`. On Nuxt 4
the file sits in `app/`. On Nuxt 3 it sits in the project root.

<table>
<thead>
  <tr>
    <th align="left">
      Key
    </th>
    
    <th align="left">
      Type
    </th>
    
    <th align="left">
      Default
    </th>
    
    <th align="left">
      What it sets
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td align="left">
      <code>
        rebuild
      </code>
    </td>
    
    <td align="left">
      <code>
        'restart'
      </code>
      
      , <code>
        'keepTime'
      </code>
      
       or <code>
        'keepValue'
      </code>
    </td>
    
    <td align="left">
      unset (falls back to the module option, then <code>
        'restart'
      </code>
      
      )
    </td>
    
    <td align="left">
      Default <code>
        rebuild
      </code>
      
       mode for the app.
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        reducedMotion
      </code>
    </td>
    
    <td align="left">
      <code>
        'never'
      </code>
      
      , <code>
        'system'
      </code>
      
       or <code>
        'always'
      </code>
    </td>
    
    <td align="left">
      unset (falls back to the module option, then <code>
        'never'
      </code>
      
      )
    </td>
    
    <td align="left">
      Reduced motion for the app.
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        preset
      </code>
    </td>
    
    <td align="left">
      <code>
        AnimationPreset
      </code>
    </td>
    
    <td align="left">
      none
    </td>
    
    <td align="left">
      The motion preset. See <a href="https://nanimejs.netlify.app/guides/presets">
        Presets
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        transitions
      </code>
    </td>
    
    <td align="left">
      <code>
        Record<string, AnimeTransitionStyle>
      </code>
    </td>
    
    <td align="left">
      <code>
        {}
      </code>
    </td>
    
    <td align="left">
      Named transition styles on top of the built-ins. See <a href="#add-your-own-transition-styles">
        Add your own transition styles
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        components
      </code>
    </td>
    
    <td align="left">
      <code>
        NanimeComponentDefaults
      </code>
    </td>
    
    <td align="left">
      <code>
        {}
      </code>
    </td>
    
    <td align="left">
      Default props for <code>
        <AnimeTransition>
      </code>
      
      , <code>
        <AnimeTransitionGroup>
      </code>
      
       and <code>
        <AnimeLayoutGroup>
      </code>
      
      . See <a href="https://nanimejs.netlify.app/guides/defaults">
        Defaults
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        composables
      </code>
    </td>
    
    <td align="left">
      <code>
        NanimeComposableDefaults
      </code>
    </td>
    
    <td align="left">
      <code>
        {}
      </code>
    </td>
    
    <td align="left">
      Default parameters for <code>
        useAnimate
      </code>
      
       and <code>
        useDraggable
      </code>
      
      . See <a href="https://nanimejs.netlify.app/guides/defaults">
        Defaults
      </a>
      
      .
    </td>
  </tr>
</tbody>
</table>

`updateAppConfig()` changes these values at runtime. Components use the
new values on their next render or run. A composable reads `rebuild`
once, when you call it, and its other defaults each time it builds or
rebuilds an animation.

## Add your own transition styles

Define a style under `nanime.transitions` in `app.config.ts`, then pass its
name to `animation`, `enterAnimation`, `leaveAnimation` or `moveAnimation`.

<table>
<thead>
  <tr>
    <th align="left">
      Part
    </th>
    
    <th align="left">
      Type
    </th>
    
    <th align="left">
      Used by
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td align="left">
      <code>
        enter
      </code>
    </td>
    
    <td align="left">
      <code className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style="">
        <span class="sBMFI">
          AnimationParams
        </span>
      </code>
    </td>
    
    <td align="left">
      <code>
        <AnimeTransition>
      </code>
      
       and <code>
        <AnimeTransitionGroup>
      </code>
      
      , for an element that appears.
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        leave
      </code>
    </td>
    
    <td align="left">
      <code className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style="">
        <span class="sBMFI">
          AnimationParams
        </span>
      </code>
    </td>
    
    <td align="left">
      <code>
        <AnimeTransition>
      </code>
      
       and <code>
        <AnimeTransitionGroup>
      </code>
      
      , for an element that disappears.
    </td>
  </tr>
  
  <tr>
    <td align="left">
      <code>
        move
      </code>
    </td>
    
    <td align="left">
      <code className="language-ts-type shiki shiki-themes material-theme-lighter material-theme material-theme-palenight" language="ts-type" style="">
        <span class="sMK4o">
          {
        </span>
        
        <span class="swJcz">
          duration
        </span>
        
        <span class="sMK4o">
          ?,
        </span>
        
        <span class="swJcz">
          delay
        </span>
        
        <span class="sMK4o">
          ?,
        </span>
        
        <span class="swJcz">
          ease
        </span>
        
        <span class="sMK4o">
          ?
        </span>
        
        <span class="sMK4o">
          }
        </span>
      </code>
    </td>
    
    <td align="left">
      <code>
        <AnimeTransitionGroup>
      </code>
      
      , for an item that slides to a new position.
    </td>
  </tr>
</tbody>
</table>

A part you leave out uses the component's default.

<render-code-block-preview :code="false" src="examples/components/TransitionCustomStylesDemo.vue">



</render-code-block-preview>

```ts [app/app.config.ts]
export default defineAppConfig({
  nanime: {
    transitions: {
      shake: {
        enter: { opacity: [0, 1], x: [0, -10, 10, -6, 6, 0], duration: 500, ease: 'inOut(2)' },
        leave: { opacity: 0, x: [0, 8, -8, 0], duration: 300, ease: 'in(2)' },
      },
      explode: {
        enter: { opacity: [0, 1], scale: [0.5, 1], duration: 350, ease: 'outBack(3)' },
        leave: { opacity: 0, scale: 2, filter: ['blur(0px)', 'blur(10px)'], duration: 400, ease: 'out(3)' },
      },
      skew: {
        enter: { opacity: [0, 1], x: [-24, 0], skewX: [20, 0], duration: 450, ease: 'out(4)' },
        leave: { opacity: 0, x: 24, skewX: -20, duration: 250, ease: 'in(3)' },
      },
    },
  },
})
```

A function value receives the element, its index and the elements that
enter or leave together. `delay: (el, index) => index * 40` staggers them.
`nanime` passes a function in `ease`, `playbackEase`, `keyframes`,
`modifier` or a callback such as `onComplete` to AnimeJS as written.
[Chain steps with keyframes](https://nanimejs.netlify.app/components/transition#chain-steps-with-keyframes)
shows a style whose properties step through several values.


## Sitemap

See the full [sitemap](https://nanimejs.netlify.app/sitemap.md) for all pages.
