Sticky Button

Sticky Button: Magnetic cursor button pulled toward the pointer from a wide capture field with parallax tilt and depth. Free MIT React & Next.js source with Motion and Tailwind CSS, live preview, CLI install and docs.

Install Sticky Button

npx motion-ui-skill add sticky-button

Components install as source into your project. The interactive page also includes preview, code, documentation and install tabs.

Dependencies

  • clsx
  • motion
  • react
  • tailwind-merge

Source files

Sticky Button

Magnetic cursor button pulled toward the pointer from a wide capture field with parallax tilt and depth.

Install

npx motion-ui-skill add sticky-button

Dependencies

  • clsx
  • motion
  • react
  • tailwind-merge

Usage

"use client";

import { StickyButton } from "@/components/buttons/sticky-button";

export function StickyButtonDemo() {
  return (
    <div className="flex items-center justify-center p-6">
      <StickyButton>Click Me</StickyButton>
    </div>
  );
}

API Reference

StickyButton

Prop Type Default Required Description
pullRadius number 150 No Cursor magnetic attraction radius in pixels
className string — No Additional CSS classes
children React.ReactNode — No Button label content

Browse this category