---
title: "TransitionGroup"
description: "Vue's <TransitionGroup> with AnimeJS enter, leave and move animations."
canonical_url: "https://nanimejs.netlify.app/components/transition-group"
---
# TransitionGroup

> Vue's <TransitionGroup> with AnimeJS enter, leave and move animations.

`<AnimeTransitionGroup>` works like Vue's
[`<TransitionGroup>`](https://vuejs.org/guide/built-ins/transition-group.html),
but always renders a wrapper element, a `div` by default. It animates
`v-for` items that enter and leave, and AnimeJS
[layout](https://animejs.com/documentation/layout) moves the rest.

## Animate a list

<render-code-block-preview :code="false" src="examples/components/TransitionGroupListDemo.vue">



</render-code-block-preview>

## API

<field-group>
<field name="animation" type="AnimeTransitionStyleName | AnimeTransitionGroupAnimation">

Enter, leave and move together. A style name sets all three, or pass
`{ enter, leave, move }`. Defaults to a fade in over 250ms and a fade out
over 150ms. [Defaults](https://nanimejs.netlify.app/guides/defaults) sets another for the app.

</field>

<field name="enterAnimation" type="AnimeTransitionStyleName | AnimationParams">

Overrides the enter in `animation`. A function value such as `stagger()`
counts the items that enter in the same update, so one item added later
starts with no delay.

</field>

<field name="leaveAnimation" type="AnimeTransitionStyleName | AnimationParams">

Overrides the leave in `animation`. A function value counts the items
that leave in the same update.

</field>

<field name="moveAnimation" type="AnimeTransitionStyleName | AnimeMoveParams | false">

How items move to a new position: a style name, `{ duration, delay, ease }`,
or `false` to skip moves. It wins over the `move` in `animation`, which
only a custom or preset style sets. Moves are skipped when reduced motion
is on. Set it to `false` when items only enter and leave, and the group
measures nothing. See
[Performance](https://nanimejs.netlify.app/guides/performance#keep-group-items-small). Defaults to
`{ duration: 350, ease: 'out(3)' }`.

</field>

<field name="deps" type="unknown[]">

Values that trigger a move when they change, including nested changes.
Adding, removing or reordering items always animates. A function entry is
read as a getter, such as `() => state.view`, so the group moves when the
getter's result changes. Without `deps`, every re-render measures all
elements, even one caused by a parent passing a new array prop.

</field>

<field name="shallow" type="boolean">

Animate only when an entry of `deps` is replaced, not when something nested
inside it changes. Defaults to `false`.

</field>

<field name="appear" type="boolean">

Run the enter animation for the items present on the first render.
Defaults to `false`.

</field>

<field name="tag" type="string">

The element rendered around the items. Defaults to `'div'`.

</field>

<field name="absoluteLeave" type="boolean">

Leaving items switch to `position: absolute` as soon as they start
leaving, so the rest close the gap while they animate out. They are placed
against the group, so give it `position: relative`. Defaults to `true`.

</field>

<field name="waapi" type="boolean">

Run the enter and leave with `waapi.animate()` instead of `animate()`.
The animation props then take `waapi.animate()` params. Moves still run
on AnimeJS layout. Defaults to `false`. See
[Keep transitions smooth during hydration](https://nanimejs.netlify.app/components/transition#keep-transitions-smooth-during-hydration-with-waapi).

</field>

<field name="completeOnTabHidden" type="boolean">

Jump running animations to their end when the browser tab is hidden.
Defaults to `false`.

</field>
</field-group>

## See also

- [`<AnimeTransition>`](https://nanimejs.netlify.app/components/transition): animate a single element
- [Transition styles](https://nanimejs.netlify.app/components/transition-styles): the built-in style names
- [`<AnimeLayoutGroup>`](https://nanimejs.netlify.app/components/layout-group): animate mounted elements that change size or position


## Sitemap

See the full [sitemap](https://nanimejs.netlify.app/sitemap.md) for all pages.
