Enter
Layout

Card

The frame used throughout this site to present a demo. Optionally magnetic, so a grid of cards subtly tracks the pointer.

Card body
Card label
Magnetic

Usage

<Card
  variant="default"
  magnetic
  magneticRadius={220}
  hoverScale={1.02}
  spring="smooth"
  label="Card label"
>
  Card body
</Card>

How the motion works

Attraction is measured from the card's centre against the document pointer position rather than a hover event, so the pull begins before the cursor arrives. Falloff is linear in distance and the result runs through a spring, which is what stops it feeling glued to the cursor. Coarse pointers skip the effect entirely.

useMagneticuseSpringValue

Props

PropTypeDefaultDescription
labelReactNodeCaption rendered beneath the body.
variant"default" | "raised" | "sunken" | "outlined""default"Surface treatment.
magneticbooleanfalseLean toward the cursor.
hoverScalenumber1Scale on hover. 1 disables the lift.
onClick() => voidMakes the card an interactive button.