Components

Transition styles

The built-in enter and leave styles, and custom ones in app.config.ts.

A style is a named set of AnimeJS params for enter, leave and move. Pass its name to the animation props of <AnimeTransition> and <AnimeTransitionGroup>.

Built-in styles

StyleAnimatesEnterLeave
fadeopacity300ms200ms
slide-upopacity, y 20px350ms250ms
slide-downopacity, y 20px350ms250ms
slide-leftopacity, x 20px350ms250ms
slide-rightopacity, x 20px350ms250ms
scaleopacity, scale 0.85300ms200ms
swapopacity, y 10px, scale 0.97260ms160ms

Inline params beat a style name, and a name beats the default. A style that does not set the part asked for, or an unknown name, uses the default.

Custom styles

Add your own under nanime.transitions in app.config.ts. Any AnimeJS param works, including keyframes, filters and eases. This site defines the six styles in the demo:

View on GitHub

Use a custom style by name, like a built-in. The editor autocompletes these names in the animation props. A style with a built-in name, such as fade, replaces the built-in.

Sequences

Params passed straight to an animation prop take AnimeJS keyframes, so one leave-animation can chain two hops, a shake and an explode:

<script setup lang="ts">
import type { AnimationParams } from '#nanime/types'

const hopShakeExplode: AnimationParams = {
  keyframes: [
    { y: -24, duration: 180, ease: 'out(3)' },
    { y: 0, duration: 150, ease: 'in(3)' },
    { y: -16, duration: 150, ease: 'out(3)' },
    { y: 0, duration: 130, ease: 'in(3)' },
    { x: -8, duration: 70 },
    { x: 8, duration: 90 },
    { x: 0, duration: 70 },
    { scale: 2, opacity: 0, filter: ['blur(0px)', 'blur(10px)'], duration: 400, ease: 'out(3)' },
  ],
}
</script>

<template>
  <AnimeTransition enter-animation="scale" :leave-animation="hopShakeExplode">
    <div v-if="show" />
  </AnimeTransition>
</template>
Copyright © 2026