ZeroGravity UI

Cursorstable

Lodestone

Magnetic buttons

Magnetic buttons that lean toward the pointer but never overlap each other.

Customize

Lookthe button face
variant
Magnethow each button reacts to a nearby pointer
150 pxradius
0.500strength
30 pxmaxDisplacement
0.160release
0.050lift
Layoutcrowd the buttons to prove they cannot overlap
12 pxminGap
4buttons
18 pxspacing

Usage

TSX
import { Lodestone } from "zerogravity/lodestone"

<Lodestone
    radius={150}
    strength={0.5}
    maxDisplacement={30}
    lift={0.05}
    variant="pixel"
>
    Get started
</Lodestone>

Generated from the controls above. Only props that differ from their defaults are shown.

Props

8 documented props on Lodestone
PropertyTypeDefaultDescription
variant"soft" | "pixel""soft"Variant.
radiusnumber130Radius. Range 40 to 400 px.
strengthnumber0.32Strength. Range 0 to 1.
maxDisplacementnumber16Max displacement. Range 0 to 80 px.
releasenumber0.16Return speed. Range 0.02 to 1.
liftnumber0.04Lift. Range 0 to 0.3.
minGapnumber12Minimum gap. Range 0 to 40 px.
childrenReactNode—Button label.

Dependencies

0 external runtime dependencies

Ships with nothing but React.