useDockFlight
FLIP animation for a dock changing edge, from a drag, a grip click or a settings menu alike. Moves on the motion tokens (--vt-duration-enter, --vt-ease) with no overshoot, and skips the flight under reduced motion.
Install: pnpm add-composable useDockFlight
Animating any edge change
Every change to the position flies the bar, whatever caused it.
API
barRef(Ref<HTMLElement | null>): The element that flies.position(Ref<DockPosition>): The edge to watch. The old box is read before the DOM updates, the new one after.takeLiftScale(() => number): The scale the bar wore when it left, so a lifted drag lands without a jump. useDockDrag provides it.flyHome((element, deltaX, deltaY, liftScale?) => void): Animates an element from a displacement back to where it is laid out. Exported for one-off flights.flightDuration(() => number): Flight duration in milliseconds, read live from --vt-duration-enter (it follows the preset and reduced motion). The flight eases on --vt-ease, with no overshoot.