Getting Started

Introduction

SSR Safe animations with animejs

Introduction

nanime is a Nuxt module that brings AnimeJS into Vue and Nuxt applications as SSR-safe, reactive composables.

Why?

AnimeJS needs the DOM, so using it in Nuxt means onMounted guards, cleanup on unmount, and care around SSR to avoid hydration mismatches. That is the same handful of lines in every component that animates anything. nanime moves it into the composables.

Features

  • SSR safe: composables are guarded against server execution, so no onMounted wrappers or client-only checks.
  • Reactive: parameters accept ref, computed and getter functions, and the animation rebuilds when the values they read change.
  • Auto-imported: registered by the module, so no imports or plugin setup.

Composables

ComposableWrapsDescription
useAnimateanimate()CSS properties, transforms, SVG and plain JS objects
useWaapiAnimatewaapi.animate()Web Animations API, off the main thread
useAnimatablecreateAnimatable()Property setters with built-in tweening, for fast updates
useAnimeTimelinecreateTimeline()Sequencing several animations on one clock
useSplitTextsplitText()Splitting text into lines, words and characters
useScrambleTextscrambleText()Scramble and reveal effects with reactive text cycling
useDraggablecreateDraggable()Drag interactions with snap, bounds and axis constraints

Next steps

  • Installation to add the module.
  • Composables for each API, with a live demo on every page.
  • Examples for full sequences built from several composables.
  • Performance for which one to reach for, and what makes one do more work than it needs to.
Copyright © 2026