Menu

Made a React button that tilts, squishes and actually feels pressable

Reddit r/reactjs·u/archeese4·16 days ago
#7Pbe7Gbr
#react#button#tilts#actually#tilt
Reading 0:00
15s threshold

Hi!! I've been working on a small React component that makes buttons feel physical, like you're actually pushing something down.

Live demo: https://react-tilt-button.vercel.app/

What it does:

Tilts toward your cursor (and follows your finger on mobile)

Sinks and squishes when you press, then springs back

Has real depth, with a side wall that holds up at any radius, even pills

Clamps your props so it never visually breaks, whatever values you throw at it

Optional glare that moves with your pointer

No dependencies, about 6KB gzipped with the CSS. There are a few style variants and spring presets (bouncy, jelly, snappy, stiff) if you don't want to tune everything yourself.

It was inspired by react-awesome-button, which I really liked, but I wanted something smaller that felt more physical, so I built this one from scratch.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.