Word Magnet

RareUI Logo

Physics-based cursor interaction where words behave like repelling magnets. Brings playfulness and interactivity to text.

Installation

pnpm dlx rareui add word-magnet

Usage

1

Basic Usage

Example
import WordMagnet from '@/components/ui/word-magnet'; export default function Hero() { return ( <WordMagnet text="Interactive Floating Text" className="text-4xl font-bold" /> ); }
2

Adjusting Physics

Control the radius and force of repulsion.

Example
<WordMagnet text="Strong Repulsion" radius={200} force={0.8} returnDelay={100} />

Features

Seamlessly integrated and optimized for high-performance React applications.

Props

PropTypeDefaultDescription
textstring"Hover over me..."The text content to check for interactions.
radiusnumber130Distance in pixels where the repulsion effect starts.
forcenumber0.45Strength of the repulsion (0-1).
dampingnumber28Resistance to motion for the spring animation.
returnDelaynumber400Delay in ms before words return to original position.
disableOnMobilebooleanfalseWhether to disable interactions on mobile devices.

“Heyy, If you made it this far, let's chat.”

Design & Developed by @heyyswap © 2026. All rights reserved.