Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsJul 2, 2026·3 min de lecture

AutoAnimate — Zero-Config Drop-In Animations for Web Apps

A zero-configuration animation library that automatically applies smooth transitions when DOM elements are added, removed, or moved within a parent container.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
AutoAnimate
Commande d'installation directe
npx -y tokrepo@latest install 97faa984-75ce-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

AutoAnimate is a zero-configuration animation utility that adds smooth transitions to your web app with a single function call. Point it at a parent element and it automatically animates child additions, removals, and position changes using the Web Animations API.

What AutoAnimate Does

  • Animates DOM changes (add, remove, move) inside a parent element automatically
  • Requires zero configuration for default smooth transitions
  • Provides official integrations for React, Vue, Svelte, Angular, and Solid
  • Uses the Web Animations API for performant, compositor-driven motion
  • Supports custom animation functions for full control over keyframes and timing

Architecture Overview

AutoAnimate uses a MutationObserver to watch a parent element for child changes. When children are added, removed, or repositioned, it calculates the delta and applies Web Animations API keyframes to transition smoothly. The library measures element positions before and after the DOM mutation, then animates the difference. Custom animation plugins can override the default keyframe generator.

Self-Hosting & Configuration

  • Install from npm and import the autoAnimate function
  • Call autoAnimate on any parent element to enable automatic transitions
  • Use framework hooks like useAutoAnimate for React or the v-auto-animate directive for Vue
  • Pass a duration number to change the default 250ms animation speed
  • Supply a custom keyframe function to replace the default fade and slide transitions

Key Features

  • Single function call enables animations with no CSS or keyframe authoring
  • Framework integrations for React, Vue, Svelte, Angular, and Solid
  • Built on the Web Animations API for GPU-accelerated performance
  • Lightweight at under 2KB minified and gzipped
  • Custom animation plugins for specialized motion effects

Comparison with Similar Tools

  • Framer Motion — React-only with a large API; AutoAnimate is framework-agnostic and zero-config
  • GSAP — professional animation timeline; AutoAnimate focuses on automatic DOM transitions
  • anime.js — manual keyframe animation; AutoAnimate detects and animates DOM changes automatically
  • Vue Transition — Vue-specific; AutoAnimate works across frameworks with the same API
  • React Spring — physics-based React animations; AutoAnimate is simpler with no spring config

FAQ

Q: Does it work without a framework? A: Yes. Call autoAnimate on any DOM element in plain JavaScript.

Q: Can I disable animations for specific elements? A: Yes. Add the data-no-auto-animate attribute to exclude an element from transitions.

Q: Does it handle list reordering? A: Yes. It tracks child positions and animates moves when their order changes.

Q: Is it accessible? A: It respects the prefers-reduced-motion media query and disables animations when the user preference is set.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires