# AutoAnimate

> One line of code that animates children being added, removed or moved inside a parent.

Source: https://tastebase.ehsanulsiam.workers.dev/browse/auto-animate

free

One line of code that animates children being added, removed or moved inside a parent.

by FormKit (Justin Schroeder)[GitHub](https://github.com/formkit/auto-animate)[npm](https://npmjs.com/package/@formkit/auto-animate)

[visit](https://auto-animate.formkit.com/?utm_source=tastebase&utm_medium=referral&utm_content=detail-page)

[https://auto-animate.formkit.com](https://auto-animate.formkit.com/?utm_source=tastebase&utm_medium=referral&utm_content=detail-preview)

## Try these

no preview

### [Motion](https://tastebase.ehsanulsiam.workers.dev/browse/motion)

The default animation library for React (formerly Framer Motion): springs, gestures, layout and exit animations.

no preview

### [FormKit Drag and Drop](https://tastebase.ehsanulsiam.workers.dev/browse/formkit-drag-and-drop)

Data-first sortable lists in about 4 KB: your array is the source of truth and reorders as you drag.

no preview

### [React Spring](https://tastebase.ehsanulsiam.workers.dev/browse/react-spring)

Spring-physics animation hooks for React, React Native and react-three-fiber.

no preview

### [tw-animate-css](https://tastebase.ehsanulsiam.workers.dev/browse/tw-animate-css)

Tailwind v4 CSS-only enter and exit animation utilities (animate-in, fade-in, slide-in-from-top).

## For your agent

##### Install

`npm i @formkit/auto-animate`

##### Use it for

- a todo, cart or filter list whose rows appear and disappear
- an accordion or form section that expands without content jumping
- a sorted table or list that reorders after a sort change

##### Skip it when

- you need custom choreography, springs per element or shared-element transitions: use motion
- exit animations that depend on component state (dialogs, toasts): use motion AnimatePresence
- lists with hundreds of rows or virtualised lists: FLIP on every child is expensive; skip animation

##### What's inside14 free

- autoAnimate()
- useAutoAnimate (React)
- useAutoAnimate (Preact)
- v-auto-animate directive (Vue)
- useAutoAnimate composable (Vue)
- Nuxt module
- createAutoAnimate (Solid)
- autoAnimate directive (Solid)
- Svelte action
- AutoAnimateDirective (Angular)
- <auto-animate> tag (Marko)
- enable() / disable()
- Options
- Plugins

##### Facts

**Frameworks**
react, vue, svelte, solid, angular, vanilla

**Styling**
unstyled

**Weight**
tiny

**Accessibility**
ok

**Maturity**
stable

**License**
MIT

**Price**
Free

##### Pairs with

[FormKit Drag and Drop](https://tastebase.ehsanulsiam.workers.dev/browse/formkit-drag-and-drop)

##### Alternatives

[Motion](https://tastebase.ehsanulsiam.workers.dev/browse/motion)

```
import { useAutoAnimate } from '@formkit/auto-animate/react'

const [parent] = useAutoAnimate()

<ul ref={parent}>
  {items.map((item) => <li key={item.id}>{item.name}</li>)}
</ul>
```

https://auto-animate.formkit.com

Loading website

[Visit](https://auto-animate.formkit.com/?utm_source=tastebase&utm_medium=referral&utm_content=floating-pill)
