Animate

Animate components as they mount and unmount

import { Animate } from "@plexui/ui/components/Transition";

Use <Animate> for transitions that do not need to affect the layout of surrounding DOM nodes (e.g. fixed size or absolute positioning): nothing → component, component → nothing, or component → another component.

Examples

Overview

<Animate> is an abstraction around <TransitionGroup> for batteries-included transition animations.

enter, exit, and initial props let you define behavior from a set of GPU-accelerated properties: opacity, x, y, scale, rotate, skewX, skewY, and blur.

Fade

Default behavior is a simple fade in/out with ease timing.

Grow

Add transform properties to enter and exit. Cubic timing is applied when transform properties are used.

Continuous transitions

Use initial to differentiate entrance and exit (e.g. emphasized entrance, subtle exit).

Cross fade

Use for icon or page cross-fades (e.g. copy button icon).

Reference

PropTypeDefaultDescription
classNamestringClass applied to the wrapper element
transitionClassNamestringClass applied to the inner TransitionGroup
enterTransitionDefinitionStyles applied to the enter transition (opacity, x, y, scale, rotate, skewX, skewY, blur, duration, delay, timingFunction)
exitTransitionDefinitionStyles applied to the exit transition
initialInitialTransitionDefinitionStyles applied before the enter transition (no duration/delay/timingFunction)
enterDurationnumberOverride computed enter duration (ms)
exitDurationnumberOverride computed exit duration (ms)
preventInitialTransitionbooleantrueWhen false, children run enter on the group's initial mount
transitionPosition"absolute" | "static""absolute"Positioning of transition states
forceCompositeLayerbooleanfalseApplies will-change for compositing; use with caution