Drag & drop
useDrag
A drag that decides on release: the element follows the pointer, then goes where you return on a spring that keeps the throw's speed. For card decks and swipe to dismiss.
Drags an element and decides where it goes when you let go. It follows the pointer with its own translate. onRelease receives its offset, its speed and where the throw would land. It returns where the element goes, or nothing to send it home. The element moves on a spring that keeps the throw speed, and Escape puts it back. A drag has no keyboard form, so add a button that calls throwTo.
Install
import { useDrag } from 'vael-ui'