design-infraGitHub
Report a problem or share feedback← Catalog

Drag

curatedfree

motion/drag

An example of making an element draggable using Motion for React's drag prop.

drag — mediumrecipeRefinedPlayful
$pnpm add motion # then adapt the free source from https://motion.dev/examples/react-drag

npm deps: motion

Our notes

drag + constraints + momentum: draggable cards, swipeable panels, sliders. Free example (motion is MIT); copy and adapt the source from the example page.
Drag preview
Source
Motion (motion.dev)
Kind
transition
Categories
transition
Use as
recipe — technique you apply to your own markup
Applies to
cardcarousel
Motion
on drag · medium · motion · low cost
Tags
motion
Licence
motion / motion/react / motion-v are MIT. Motion+ (premium components, example source, AI Kit pro tools) is paid — one-time Personal licence or per-seat Business.
Live demo
motion.dev
Docs
motion.dev