Move
Core
position is the item's requested top-left in canvas coordinates. The solver infers intent from the overlap with siblings and returns the first strategy that applies; see solver behavior for the order. The result is a complete new layout, so during a drag you paint result.layout on every pointer move and keep the last accepted one on release.
To move without alignment snapping (for example while a modifier key is held), pass snap: false. Bounds, gap, and constraints still apply.
Reading the strategy
For logging every solve without touching call sites, pass onTrace once:
React
GridCanvas already handles pointer moves. For programmatic moves use the actions:
actions.move runs the solver on the rendered layout, emits onLayoutChange with reason: 'move' and the strategy, and returns false when rejected. The arrow keys do exactly this by default; see keyboard controls.