How to use

01Import the component
import WordMagnet from "@/components/shitui/WordMagnet";
02Use in your application
export default function MyComponent() {
return (
  <WordMagnet 
    text="Hover over these words and watch them dance across the screen with physics-based interaction"
  />
);
}

Features

Words are pushed away by the mouse cursor using spring physics.

Props

PropTypeDefaultDescription
textstring"Hover over..."The text content to display
radiusnumber130Interaction radius in pixels
forcenumber0.45Repulsion force (0.1 to 1.0)
dampingnumber28Spring damping (5 to 50)
returnDelaynumber400Delay before returning to original position in ms
textColorstring"#000000"Text color
fontobject{ fontSize: '32px', ... }Font styling object
disableOnMobilebooleanfalseDisable interaction on mobile devices
overflowstring"visible"CSS overflow property
classNamestring-Additional class names
styleobject-Inline styles
Component Info