Anticipation
Also called wind-up or anticipation animation
A small move in the opposite direction just before the main action, like crouching before a jump, so the motion that follows reads clearly.
import { useAnimate, useReducedMotion } from 'motion/react';
// The wind-up: a small step back before the real move.
const WIND_UP = { x: -6, duration: 0.15 };
const FLIGHT = { x: 28, y: -28, duration: 0.35 };
export function SendButton({ onSend }: { onSend: () => void }) {
const [scope, animate] = useAnimate<HTMLSpanElement>();
const reduceMotion = useReducedMotion();
async function send() {
onSend();
const plane = scope.current;
if (reduceMotion) {
await animate(plane, { opacity: [1, 0.4, 1] }, { duration: 0.3 });
return;
}
await animate(
plane,
{ x: WIND_UP.x },
{ duration: WIND_UP.duration, ease: 'easeOut' }
);
await animate(
plane,
{ x: FLIGHT.x, y: FLIGHT.y, opacity: 0 },
{ duration: FLIGHT.duration, ease: 'easeIn' }
);
// Reset out of sight, then fade back in at the start.
await animate(plane, { x: 0, y: 0 }, { duration: 0 });
await animate(plane, { opacity: 1 }, { duration: 0.2 });
}
return (
<button
type='button'
onClick={send}
className='flex items-center gap-2 overflow-hidden rounded-full bg-blue-600 px-5 py-2.5 text-sm font-medium text-white'
>
Send
<span ref={scope} aria-hidden className='inline-block'>
<svg
viewBox='0 0 24 24'
className='size-4 fill-none stroke-current stroke-2'
>
<path
d='M22 2 11 13M22 2l-7 20-4-9-9-4 20-7z'
strokeLinejoin='round'
/>
</svg>
</span>
</button>
);
}When the user taps "Send", make the paper plane icon pull back 6px to the left over 150ms, then fly up and to the right off the button over 350ms with an ease-in curve, and fade back in at its start. Use only a short opacity fade when prefers-reduced-motion is set.
Paste into Layerwise or any AI coding tool.
What is Anticipation?
Anticipation is one of the 12 principles of animation described by Disney animators Frank Thomas and Ollie Johnston. Before a big movement, the object pulls back a little: a ball squashes before it leaps, a card dips before it flies off, an arrow slides left before it shoots right. The short wind-up tells the eye where to look and makes the main move feel powerful.
In interfaces it works best on deliberate, one-off moments: sending a message, launching a rocket on an onboarding screen, dismissing a card, or a playful call-to-action. Keep the wind-up small, around 5 to 10 percent of the travel distance and 100 to 200ms, so it adds energy without making people wait.
Leave it out of everyday responses such as menus and dropdowns, where any backward step feels slow. For a quick CSS version, an easing curve that dips below zero at the start, such as cubic-bezier(0.36, 0, 0.66, -0.56), pulls the element back slightly before it accelerates.
Often confused with
- Overshoot easing
- Overshoot easing goes past the target at the end and settles back. Anticipation moves backward at the start, before the main motion.
Related terms
All termsFollow-through
When the main object stops but loose, attached parts keep moving for a moment, swing past, and settle, which makes motion feel physical.
Squash and stretch
Stretching an object along its path when it moves fast and flattening it on impact, so it looks elastic and has weight.
Keyframes
Snapshots that define how an element looks at set points in an animation. The browser fills in the motion between them.
Ease-in
An easing curve that starts slowly and speeds up toward the end, like a car pulling away from a stop.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.