reframe/ui
reframe/ui

Command Palette

Search for a command to run...

Sticky Cursor and Magnet

Move your mouse around. Hover the outlined target to see the cursor stick and stretch. The buttons use the Magnet wrapper to subtly pull toward the pointer.

Installation

Install Dependencies

Copy and Paste the component

@/components/reframe-ui/sticky-cursor-and-magnet.tsx
PRO COMPONENT

Unlock with PRO

This component is exclusive to reframe/ui PRO.
Get instant access to all premium components and templates.

Usage

Props

NameTypeDefaultRequiredDescription
StickyCursor stickyRefReact.RefObject<HTMLElement>-YesRef to the target element that the cursor sticks to when hovered.
StickyCursor baseSizenumber15NoCursor size in pixels when not hovering the target.
StickyCursor hoverSizenumber60NoCursor size in pixels when hovering the target.
StickyCursor positionSpring{ damping?: number; stiffness?: number; mass?: number }-NoSpring options for smoothing the cursor position.
StickyCursor resetDurationnumber0.1NoDuration in seconds for resetting scale on mouse leave.
StickyCursor cursorClassNamestring-NoClass names for the cursor element. Uses Tailwind by default.
StickyCursor zIndexnumber50Noz-index of the cursor container.
Magnet childrenReact.ReactNode-YesContent to apply magnetic behavior to.
Magnet stiffnessnumber350NoSpring stiffness for the magnetic motion.
Magnet dampingnumber5NoSpring damping for the magnetic motion.
Magnet massnumber0.5NoSpring mass for the magnetic motion.
Magnet intensitynumber0.1NoHow strongly the element moves toward the pointer.
Magnet classNamestring-NoClass names applied to the magnetic wrapper.
Magnet styleReact.CSSProperties-NoInline styles applied to the magnetic wrapper.
© Copyright 2025. All rights reserved.Built by @thommysart