Skip to content

Magnet

Wraps a button, card or icon and pulls it toward the cursor with spring physics. Works well on calls to action.

Plan
Free · MIT
Dependencies
React only
Props
8 (5 adjustable)

Free forever

MIT license, for personal and commercial projects. See installation

Pull me in

Made with Furin: Pill Nav · Metal Button · Copy Morph

Props

PropTypeDefaultDescription
childrenReactNode""What gets pulled: a button, a card, an icon, anything.
strengthnumber0.4How close it gets to the cursor: 0 doesn't move, 1 follows it exactly.
radiusnumber140Distance in px, measured from the element's edge, at which the pull starts.
stiffnessnumber170Spring stiffness: higher responds faster.
dampingnumber11Spring damping: lower bounces more when returning.
disabledbooleanfalseTurns the pull off (the element stays still).
classNamestring""Extra CSS class for the container.
styleCSSProperties"{}"Inline styles for the container.

Installation

Install it

1Install the package

npm i furin-ui

2Import it

import { Magnet } from "furin-ui";

Also with pnpm add furin-ui, yarn add furin-ui or bun add furin-ui. Each component ships its own CSS and imports it for you.

Dependencies

React
18 or later
Other libraries
none
License
MIT

Each file ships its own CSS: there's nothing else to install.

Keep exploring

  • A thread with physics that follows the cursor.

    Interaction

  • A bell with sound and a notification count.

    Interaction