Lumeo

MagneticButton

A container that translates toward the cursor when it enters the magnetic radius, creating a satisfying pull effect.

When to Use

  • Call-to-action buttons that benefit from playful cursor interaction.
  • Navigation items or social links on landing pages.
  • Any interactive element where subtle magnetism adds delight without distraction.

API Reference

Property Type Default Description
ChildContentRenderFragment?nullThe element(s) that will be magnetically attracted.
Radiusint80Radius in px within which the magnet activates.
MaxTranslateint20Maximum translation in px in any direction.
TransitionDurationstring"300ms"CSS transition duration for the settle-back animation.
  • Dock — macOS-style dock with magnification on hover.
  • Spotlight — Radial gradient spotlight following the cursor.