Skip to content

Framer Overrides

Spring-Physics Magnetic CTA Button & Cursor Follower

The button leans toward the pointer on a spring and snaps back on leave, while a follower dot trails the cursor. Both run on motion values or quickTo, so nothing re-renders while moving.

Spring · No re-renders

Works in Webflow Framer React Zero CLS

Customize before you copy

Platform
Motion timing

Showing the Webflow version

Claude prompt · production spec
You are a senior interaction developer. Build a magnetic CTA button and a cursor follower.

1. Magnetic button:
- On pointer move over the button, measure its bounding rect and pull it toward the pointer: offset = (pointer - centre) * 0.35, clamped to ±18px.
- Drive it through a spring (stiffness 220, damping 22) or an equivalent 0.8s "expo.out" retargeting tween, so it lags slightly and overshoots on release.
- On pointer leave, return to 0 with the same spring.
- Expose strength (0.35) and clamp (18) as constants at the top.

2. Cursor follower:
- A small circle, fixed position, pointer-events: none, high z-index, centred on the cursor.
- Follows the pointer with a softer spring than the button.
- Only on fine pointers: hide it entirely on touch devices.

Constraints:
- No per-frame state updates or re-renders: motion values, quickTo or direct transforms only.
- Respect prefers-reduced-motion: no magnet, no follower.
- Clean up every listener.

Deliver the complete code plus two lines on how to attach it.

Target platform: Webflow.
- Build the structure as native Webflow Designer elements with Client-First class names (section_[name], [name]_component, [name]_item). No div soup from an HTML embed unless I ask for one.
- Hook every behaviour to custom attributes (data-gsap="…"), never to class names, so designers can restyle without breaking the script.
- Load GSAP through Webflow's built-in GSAP integration (Site settings) or the jsDelivr CDN tags, and put the init script in Page settings → Before </body> tag, wrapped in Webflow.push(() => { … }).
- Say which parts go in Designer styles, which in a page-head <style>, and which in the body script.
- Designer: add data-magnetic to any Button or Link Block, and one empty div with data-cursor (place it last in the body, size 14px, rounded, background set in Designer).
Motion timing: "Editorial". Use a base duration of 0.8s, ease "expo.out" (CSS: cubic-bezier(0.16, 1, 0.3, 1)), stagger 0.08s, scrub smoothing 0.8, and springs of stiffness 220 / damping 22, everywhere a duration, ease or spring appears.

3-step implementation guide

  1. Step 1

    DOM & attribute setup

    Pick one or two primary CTAs only (a magnet on every button gets tiring) and add one small follower element that sits above everything with pointer-events: none.

  2. Step 2

    Prompt Claude or drop in the snippet

    Paste the prompt with your platform selected, or drop in the snippet. Strength and clamp are constants at the top; the spring or timing comes from the Motion Timing toggle above.

  3. Step 3

    Mobile & Core Web Vitals check

    On a phone the follower must not render at all, and taps must hit the button exactly. On desktop, check the button still receives focus styles and that INP stays green in PageSpeed Insights.

Building a full site like this?

Skip the manual setup — I ship complete Figma-to-Webflow & Framer builds in 5–10 business days, or can wire this exact interaction into your live site in 48 hours ($250).