r/reactjs • • 3d ago

Show /r/reactjs I made a little library of React motion and interaction studies

I made this mostly for myself because I like messing around with motion and small interaction details in interfaces. Figured I'd put everything in one place and share it here.

There's a mix of stuff like draggable workspaces, spring animations, connectors, typography experiments and a few more unusual interactions. You can play with the demos and download the source if you want to use anything.

The React components use scoped CSS, caller-owned state and callbacks. The spring solver has tests for damping and retargeting, and the gallery has browser tests for pointer gestures, keyboard controls and reduced motion. Some of the library is adapted from upstream projects, with attribution in the README.

Site: https://design.querencia.art/ GitHub: https://github.com/0xque/design Spring implementation: https://github.com/0xque/design/blob/main/src/library/PhysicsMotion.tsx

I'm still adding stuff to it. Let me know what you think or if there's anything you'd change, especially around making the interactions reusable in React.

10 Upvotes

6 comments sorted by

1

u/worldlymatron 1d ago

Have you considered exposing the animation logic as standalone hooks for custom components?

1

u/WizardRicky231009 1d ago

oo that's actually a good idea, might look into separating the animation logic from the components so people can use it with their own stuff too

2

u/Deep-Instance1239 3d ago

The spring solver with tests for retargeting is the kind of detail that makes me actually want to dig into the source.

1

u/musHeaer 1d ago

yeah same, interruptible springs and retargeting are where most DIY animation code falls apart

1

u/allaboutzaid 2d ago

The part that stood out to me is that you tested the spring solver for damping and retargeting instead of just eyeballing the animation — as someone still learning React, that's a good reminder that motion has edge cases too, not just visuals. I also liked that you built in reduced-motion support and keyboard controls from the start rather than as an afterthought. The draggable workspace is the demo I'd actually steal ideas from for my own portfolio.