Skip to main content
Version: next

Animation Modifiers Overview

A modifier tells useValue how to get to a target. Without one, a value snaps instantly:

import { useValue, withSpring } from 'react-ui-animate';

const [x, setX] = useValue(0);

setX(100);
setX(withSpring(100));

Available modifiers

ModifierMotionBest for
withSpringPhysics-basedButtons, cards, modals, anything that should feel alive
withTimingFixed durationTooltips, dropdowns, progress bars
withDecayMomentum/frictionFlicks, swipes, momentum scrolling
withSequenceMulti-step, in orderChoreographed, multi-phase motion
withDelayPauseA step inside withSequence
withStaggerPer-item delayStaggering a list (with withParallel)
withKeyframesMultiple stops, one callShorthand for a withSequence of withTiming steps
withParallelDifferent driver per keyObject/array values where keys need different timing
withLoopRepeatsSpinners, pulses, ambient motion

Composing modifiers

setX(withSequence([withTiming(50, { duration: 200 }), withSpring(100), withDecay(0.3)]));

setX(withLoop(withSequence([withSpring(100), withSpring(0)]), 3));

Callbacks

Every modifier accepts onStart/onChange/onComplete:

setX(withSpring(100, {
onStart: () => {},
onChange: (value) => {},
onComplete: () => {},
}));

Next steps

Pick a modifier above, or continue to Presence & Layout to use these as exit animations.