Shake animation

Also called error shake or wiggle animation

A quick side-to-side jiggle that tells someone their input was rejected, such as a wrong password or an invalid code.

What is Shake animation?

A shake moves an element left and right a few times in under half a second, with each swing smaller than the last. It mimics a head shaking "no", so people sense the problem before they read the error. The macOS login screen shakes the password field this way.

Use it for a failed sign-in, a wrong one-time code, or a form submitted with missing fields. Always pair it with a visible error message and a color change: the shake grabs attention, and the text explains what to fix.

Keep it short, about 300 to 500ms, with swings of 6 to 12px; bigger swings feel harsh. Some people find sudden motion uncomfortable, so when prefers-reduced-motion is set, skip the shake and rely on the red border and message.

All terms

Inline validation

Form checking that happens right next to each field as you fill it in, showing an error or a checkmark before you press Submit.

Keyframes

Snapshots that define how an element looks at set points in an animation. The browser fills in the motion between them.

Reduced motion

An operating system setting that asks apps to minimize movement, which websites detect with the prefers-reduced-motion media query.

Micro-interaction

A small moment of feedback around a single action, like a heart that bursts when tapped or a copy icon that turns into a checkmark.