0Declarative Dragging: derive drag-and-drop from model state | Sébastien Rigaux
Sébastien Rigaux

Declarative Dragging: derive drag-and-drop from model state

Article
View resource

declarative-dragging.github.io

Declarative Dragging replaces hand-coded drop zones and animations with a description of the model states reachable by dragging an element. The engine computes and renders those future states, then derives possible positions to produce the interaction.

The Dragology library implements this approach for web-based SVG interfaces. Its behaviors can be composed and extended with modifiers for floating, snapping, and transitions; demos also show parallel representations updating during a drag.

Diagram of declarative dragging: a model produces a view, possible target states are rendered speculatively, and the dragged element’s position determines drop zones and the animated interaction.