Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

6.5 KB
Raw Blame

04 — Micro-Interactions & UI Animation

Short, user-triggered animations that provide feedback, confirm actions, and communicate state. They start the moment the visitor acts and stay short (see Duration discipline below), so they feel instant, not decorative.

Animations

Demo Description
Hover State Animation Six ways a card can react when you point at it. Best for buttons and cards.
Click / Tap Ripple A ripple spreads out from the spot you press. Best for buttons and list items.
Focus Ring Animation A ring closes in around the item the Tab key reaches. Best for forms and menus.
Button Press Scale Shrinks as you press it and springs back as you let go. Best for main buttons.
Magnetic Button Leans toward the pointer, then springs home. Best for one main button.
Toggle / Switch Slide The knob slides across as the switch turns on or off. Best for settings.
Heart / Like Burst The heart pops and fills as small hearts burst out. Best for like buttons.
Success Confetti Confetti bursts from the button when a task is done. Best for big moments.
Skeleton Loader Gray shapes hold the place of content while it loads. Best for feeds and cards.
Shimmer Effect A band of light sweeps over gray placeholders. Best for loading screens.
Loading Spinner Six small shapes loop to show that something is loading. Best for short waits.
Progress Animation A bar, a ring and steps fill up to show progress. Best for uploads.
Checkmark Draw A tick draws itself in a circle once a task succeeds. Best for forms.
Form Field Morph The label moves up out of the way as you type. Best for sign-up forms.
Notification Badge Pulse A badge on an icon pulses to catch the eye. Best for unread messages.
Tooltip Reveal A small label fades in after a short pause. Best for icon buttons.
Drawer / Panel Slide A side panel slides in over a dimmed page. Best for mobile menus.
Modal Expand A window grows out of the button you pressed. Best for detail views.
Accordion Open/Close Each question opens smoothly to show its answer. Best for FAQ pages.
Cursor Follower A dot trails your pointer and flips the colors under it. Best for portfolios.
Error Shake A field shakes side to side when the input is wrong. Best for sign-in forms.
Swipe to Dismiss A card dragged sideways flies off and the list closes up. Best for inboxes.
Hamburger Menu Toggle Three lines turn into an X as the menu opens. Best for mobile menus.
Theme Toggle Morph A sun turns into a moon as the colors switch to dark. Best for theme buttons.
Copy to Clipboard Copy turns into a tick and Copied, then changes back. Best for codes and links.
Star Rating Stars fill up to your pointer and pop when you choose. Best for reviews.
Toast Notification Short messages slide into a corner, then leave on their own. Best for updates.
Segmented Control A highlight slides to the option you pick. Best for switching views.
Pull to Refresh Pulling a list down shows a spinner, then new items. Best for feeds.
Animated Gradient Border A band of colors runs around the edge of a card or button. Best for featured offers.
Spotlight Hover Glow A soft glow follows the pointer and lights card edges. Best for feature grids.
Add-to-Cart Fly The product flies into the cart, which bumps and counts up. Best for shops.
Drag to Reorder Drag an item and the others slide aside to make room. Best for to-do lists.
Rolling Numbers Each digit rolls to its new value, like a mileage counter. Best for prices.
Typing Indicator Three dots in a chat bubble move in turn while someone types. Best for chat apps.
Hold to Confirm A button fills up while you hold it and acts only once it is full. Best for delete buttons.
Expanding Search A search icon opens into a field, then closes when done. Best for toolbars.
Button Loading States The button becomes a spinner, then a tick or a cross. Best for Save buttons.
Image Trail Pictures pop up in a trail behind your pointer, then fade. Best for portfolios.
Gooey Menu Small buttons ooze out of a round button like liquid. Best for quick actions.
Dynamic Island A black pill grows into a notification, then shrinks back. Best for live updates.
Before/After Slider Drag a line across two pictures to compare them. Best for photo edits.
Magnifier Lens A lens follows your pointer and shows the picture up close. Best for product photos.
Card Deck Swipe Swipe the top card left or right; the next one rises. Best for quick choices.

Key concepts

Duration discipline: Feedback should begin the moment the visitor acts and stay short: about 200ms or less for a hover change and under about 100ms for a press to show. A change that shows a new state, such as a ripple, a morph or a panel opening, usually takes 300–600ms; much longer and feedback starts to feel like decoration.

Asymmetric timing: press events animate faster than release events (80ms press / 180ms release for button scale). Opening events are slightly slower than closing (280ms open / 220ms close for drawers). The asymmetry matches physical intuition.

Touch parity: every hover-triggered effect needs an :active or pointerdown equivalent on touch. Use @media (hover: hover) to gate hover-only styles.

Reduced motion: all demos respect prefers-reduced-motion: reduce. Disable motion, preserve state changes.

See also