Skip to content

feat: animations toggles + onAnimationEnd callback (#153, #37) - #255

Merged
justin-schroeder merged 1 commit into
masterfrom
feat/animations-toggle-and-end-callback
Nov 22, 2026
Merged

justin-schroeder merged 1 commit into
masterfrom
feat/animations-toggle-and-end-callback

Conversation

@justin-schroeder

Copy link
Copy Markdown
Member

Closes #153, closes #37.

Two small, additive options. Defaults are unchanged.

autoAnimate(el, {
  // turn single animations off, keep the defaults for the rest (default: all true)
  animations: { remain: false },
  // called when an element's animation finishes
  onAnimationEnd: (el, action) => { /* 'add' | 'remove' | 'remain' */ },
})
  • animations (feature request: enable only the animations we need #153): e.g. { remain: false } alongside drag-and-drop libraries that already move items, or { add: false, remove: false } to keep only the FLIP moves. A disabled remove takes the element out immediately; a disabled add/remain just records positions, same as the existing disabled path. Plugins still decide for themselves.
  • onAnimationEnd(el, action) ([Feature request] Add a callback option when animation is completed #37): fires on finish only (not on cancel or skip). For remove it fires after the element has left the DOM. It is not called for plugins, which own their keyframes.
  • New exported type AutoAnimateAction. Every adapter takes Partial<AutoAnimateOptions>, so both options work in Vue/React/Solid/Svelte/Angular/Preact/Qwik.

Tests: new animations-option.spec.ts covers default, { remain: false }, { add: false, remove: false }, and callbacks per action. It passes 27/27 over 3 repeats on Chromium, Firefox and WebKit. The full e2e suite: 94 passed, 8 skipped. The docs config example is updated.

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
auto-animate Ready Ready Preview Nov 22, 2026 7:44pm UTC

Request Review

@justin-schroeder
justin-schroeder merged commit db183b5 into master Nov 22, 2026
3 checks passed
@justin-schroeder
justin-schroeder deleted the feat/animations-toggle-and-end-callback branch November 22, 2026 19:47

This branch was successfully deployed

1 active deployment
Preview — e0fcb0a7 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: enable only the animations we need [Feature request] Add a callback option when animation is completed

1 participant