GSAP Hover and Cursor Effects

Over 48

Pointer-driven animations that respond to hover, mouse position, movement speed and drag. Magnetic attraction, particle trails, morphing shapes, cards you can throw and smooth layout transitions, all powered by GSAP. 48 effects, 3 free, no build step.

The Vault. Every item in the library, including the Vault exclusives, and everything added to it.

Browse effects

48 effects

    Quick view

    Loading demo

    Designing Hover and Cursor Interactions with GSAP

    Hover effects provide immediate visual feedback when users interact with elements. A button that subtly scales, a card that reveals hidden content, or a shape that morphs on mouseenter: these interactions signal that elements are interactive and reward exploration.

    GSAP makes hover animations smooth by handling the transition between states with proper easing and interpolation. Unlike CSS hover transitions that snap to a new state on fast mouse movements, GSAP animations complete gracefully even if the cursor leaves mid-transition.

    The best hover effects serve a functional purpose. A liquid melt on a product photo invites a closer look. Text distortion on a navigation link adds personality to wayfinding. Layout morphs with GSAP Flip provide spatial continuity when content rearranges.

    These effects include both the mouseenter and mouseleave animations, ensuring elements return to their original state smoothly. They handle rapid hover/unhover cycles without animation conflicts using GSAP's overwrite modes.

    Custom cursors take the same idea further by replacing the default pointer entirely. A magnetic button pulls toward the cursor as it approaches, a trail of particles follows mouse movement, and a confetti burst rewards a click. GSAP interpolates these positions with gsap.quickTo() rather than updating on every high-frequency mousemove event, which is what keeps them fluid at 60fps.

    Touch devices receive alternative interactions since neither hover nor a persistent cursor is available. Some effects trigger on tap, others use scroll-based activation, and cursor effects detect the pointer type and disable themselves. Content and functionality are identical either way; only the visual enhancement is removed.

    How to make a magnetic hover button with GSAP

    Pull an element toward the pointer while it hovers, then spring it back on leave. Measure the pointer offset from the element centre and tween a fraction of it.

    1. 1

      Track the pointer

      On pointermove over the element, read its bounding rect and the pointer position.

    2. 2

      Tween a fraction of the offset

      Move the element a portion (e.g. 0.4) of the distance from its centre to the pointer so the pull feels weighted.

    3. 3

      Spring back on leave

      On pointerleave, tween x and y back to 0 with an elastic ease for a natural release.

    Minimal example
    import gsap from "gsap";
    
    const btn = document.querySelector(".magnetic");
    
    btn.addEventListener("pointermove", (e) => {
      const r = btn.getBoundingClientRect();
      gsap.to(btn, {
        x: (e.clientX - (r.left + r.width / 2)) * 0.4,
        y: (e.clientY - (r.top + r.height / 2)) * 0.4,
        duration: 0.4,
        ease: "power3.out",
      });
    });
    
    btn.addEventListener("pointerleave", () => {
      gsap.to(btn, { x: 0, y: 0, duration: 0.5, ease: "elastic.out(1, 0.3)" });
    });

    Hover & Cursor at a glance

    Compare the 48 hover & cursor in this category by what they do, technique, and difficulty.
    Effect What it doesBuilt withDifficulty
    Text Roll Hover Nav links and button labels that roll over letter by letter like little lit cubes, built on GSAP SplitText, reacting to how fast the pointer arrives and rippling into neighbouring links. SplitText, text-animation beginner
    Gooey Liquid Nav A navigation bar whose active indicator is one body of glossy liquid. webgl-shader advanced
    Directional Hover Fill An ink fill that enters where your pointer arrives, bows into the surface and drains through the edge you leave. hover-effect intermediate
    Room 101 Drag, throw or press the web's pet hates into Room 101: a heavy door eases ajar as they near it, pulls them into the dark and slams shut with a rattle. Draggable, InertiaPlugin, draggable advanced
    Inflatable Type A headline of glossy, air-filled 3D balloon letters on curling ribbon strings. webgl-shader advanced
    Shadow Assembly Drag a low spotlight freely across the floor to reshape the word or monogram cast by a suspended matte black sculpture. webgl-shader advanced
    Fogged Glass Reveal Look through a rain-covered window into a misty forest. webgl-shader advanced
    Sand Reveal Brush uneven mounds of pale sand across a graphite board, leaving fine grain trails and gathering material into shaded piles. canvas advanced
    Scratch Card Reveal Scratch silver foil to reveal a photograph or discount code. canvas intermediate
    Lenticular Card Tilt a ridged card to reveal an alpine lake from day to night, with optical interlacing, moving plastic highlights and a physical settle. webgl-shader advanced
    Lens Slider Wall An infinite wall of sliding photographs that bow through a velocity lens and lift seamlessly into a large viewer. webgl-shader advanced
    Magnetic Cursor Effect Elements attract or repel from the cursor with elastic physics. cursor-effects intermediate
    Cursor Confetti Trail A responsive GSAP confetti trail that turns fast pointer sweeps and touch drags into colourful, directional ribbons of tumbling geometric particles. pointer-effects intermediate
    Elastic Repel Headline A cursor-repulsion display headline whose letters flee the pointer, scaled by cursor speed, then spring back home with an elastic overshoot, motion blur, and a scale dip. hover-effect advanced
    Liquid Morph Hover Effect A GSAP liquid morph hover effect in WebGL: photographs melt into thick, glossy liquid that sags, smears and drips, then pull back together crisp. webgl-shader advanced
    SVG Blob Morph Organic blob masks that morph between shapes with MorphSVGPlugin. MorphSVG, morphing intermediate
    Text Hover Distortion Characters react to cursor proximity with push, pull, wave, or rotation effects. text-animation advanced
    Cursor Trail Effect A portable editorial cursor with dot-and-ring lag, velocity afterimages, elastic target labels, colour morphs, and touch previews. cursor-effects intermediate
    FLIP Layout Morph Shared-element layout transitions with GSAP Flip: a grid tile travels into a detail view while its neighbours reflow into a strip, swaps with any of them in one crossing move, and returns to its exact slot. Flip, flip-layout intermediate
    Canvas Shape Vortex A photoreal spiral galaxy on a 2D canvas: logarithmic arms, clustered star fields, additive bloom and diffraction spikes, flown by scroll and pointer with no WebGL. ScrollTrigger, canvas advanced
    Hover Image Trail Velocity-aware image trail for a list of links: layered card drift, directional tilt, staggered decay, and static touch previews. cursor-effects intermediate
    Hover Underline Four material link underlines (an exit-through line, marker sweep, hand-drawn wave, and an endlessly travelling wave) with coordinated type and active-index responses. hover-effect beginner
    Grid Shockwave An interactive tile wall where every click detonates a radial shockwave: tiles pop, flash, and tip away from the epicentre in a distance-staggered ring wave, then settle with elastic overshoot. grid-animation intermediate
    Liquid Ripple Image A WebGL water ripple for any image: drag across it and rings of waves spread from the pointer, cross and interfere, bending the picture, then settle to a calm pool. webgl-shader advanced
    Cursor Spotlight Mask A soft aperture follows the cursor and reveals a completely different layer hidden under the visible one, stretching into a lens streak on the axis of movement and springing back with an elastic settle. mask-reveal advanced
    Velocity Slice Image A velocity-reactive image effect that peels one photograph into alternating horizontal slats with directional depth, warm edge light, and a zipper-like settle. velocity-reactive intermediate
    Physics Word Pile Display-type chips that fall, collide, tumble and stack under a real rigid body solver, with drag-and-fling throwing. physics advanced
    Sticker Peel Drag a sticker's corner and it peels back along a real moving fold, then rips clean off the sheet with your release velocity. draggable advanced
    Holo Foil Card Trading-card holographic tilt: one pointer drives 3D rotation, an iridescent foil sheen, twinkling glitter, depth parallax and a specular bloom, then settles elastically. 3d-transforms advanced
    Curtain Menu Overlay A fullscreen nav overlay that arrives as layered clip-path curtains, oversized type masking up on a stagger, and a preview plate that wipes in the direction you moved. clip-path advanced
    Plucked Strings Interactive elastic strings that bend around your cursor and twang back with damped oscillation — with an opt-in sound toggle that voices every pluck as a synthesized, guitar-tuned string note. pointer-effects advanced
    Cobweb Tear A Halloween overlay that spins a real physics cobweb across the page: drag through it to stretch and snap the silk until it drops away and reveals what is underneath, with an option to have the web itself spell out a short phrase. canvas advanced
    Interactive Halftone Image An image rendered live as a halftone dot grid the pointer drags through: dots swell, smear along the stroke and split into misregistered ink at speed, then settle back elastically. canvas advanced
    Magnetic Glass Lens A glass loupe that follows the cursor and magnifies the live page beneath it, with refraction wobble, chromatic fringing and 3D tilt momentum. cursor-effects advanced
    Kinetic Shutter Blinds Slices a hero design across a bank of 3D venetian louvres that crack open under the cursor in a proximity wave, revealing a second layer behind and a third printed on their reverse. Observer, 3d-transforms intermediate
    Elastic Photo Mesh Interactive rubberized photo mesh: click, drag, or sweep across any image to stretch and warp the canvas texture with spring-mass physics, elastic tension, and gelatin reverberations. canvas advanced
    Funhouse Portrait Inflate noses, squeeze faces and twist smiles with a playful three.js portrait filter that springs back on release. webgl-shader advanced
    Reactive Face Mesh Pull any part of a portrait out like taffy and the face reacts: eyes follow your hand, widen in surprise, blink as it snaps back. webgl-shader advanced
    Slit-Scan Stretch A full-bleed photograph read through a moving slit, like a 1970s photo-finish camera: sweep across it and the picture smears into long streaks that trail the pointer's path, fringed with colour, then retract into the slit and settle. webgl-shader advanced
    3D Card Flip Gallery Tactile GSAP 3D cards with deep perspective, reactive edge lighting and shifting shadows. ScrollTrigger, 3d-transforms intermediate
    Draggable Card Stack Swipeable card deck powered by Draggable and InertiaPlugin. Draggable, InertiaPlugin, draggable intermediate
    Page Turn Book A GSAP page-turn effect with curved paper, moving highlights and momentum. Draggable, InertiaPlugin, page-turn advanced
    Twang Lanyard A two-leg SVG lanyard simulation that lets a weighted event pass fall, whip, twist, and settle through damped rope constraints. rope-physics advanced
    Pinboard Notes Notes and prints pinned to a cork board. pointer-drag intermediate
    Interactive Swatch Book A tactile material sample fan with a shared hinge and flexible fabric. draggable intermediate
    Tailwind Component Remixer Generate fresh Tailwind component recipes with procedural SVG artwork, coordinated colour palettes and animated GSAP layout transitions. Flip, tailwind-css intermediate
    Glowing Border Card Hover Effect One holographic light shared by a whole grid of cards: the borders nearest your pointer turn to iridescent foil with a white specular, neighbouring edges catch it, and a featured card carries a travelling foil beam. hover-effect intermediate
    Envelope Advent Calendar An advent calendar of paper envelopes pinned to a cork board. 3d-transforms advanced

    Frequently asked questions

    How do hover and cursor effects work on touch devices?

    Touch devices support neither true hover nor a persistent cursor. These effects detect the input type and provide alternative triggers on mobile: some activate on tap or drag, others use scroll position, and pure cursor followers switch off while keeping the content fully accessible.

    Can I add hover effects to existing buttons and links?

    Yes. These effects are designed to enhance existing HTML elements. You add a data attribute or class to your button or link, include the effect script, and the hover animation is applied automatically. No structural HTML changes needed.

    What is GSAP Flip for layout animations?

    GSAP Flip records an element's position and size, lets you make DOM changes (like moving it to a new container), then animates smoothly from the old state to the new state. It handles layout transitions that would otherwise cause jarring jumps.

    How do I prevent hover animations from interfering with each other?

    GSAP's overwrite modes prevent animation conflicts. When a new hover animation starts, it automatically kills conflicting tweens on the same element. Use overwrite: "auto" (the default) or manage timelines explicitly for complex sequences.

    Will a custom cursor slow down my website?

    Not if implemented correctly. The cursor effects here run on GSAP's ticker rather than raw mousemove handlers, animate transforms where they touch the DOM, and avoid layout recalculations, so they hold a smooth frame rate on modern hardware and clean up when removed.

    How do I customize the cursor appearance?

    Each cursor effect uses standard HTML and CSS for the cursor element. You can change size, color, shape, blend mode, and opacity through CSS custom properties documented in each effect. The GSAP animation handles the motion; the CSS handles the look.