StealThis .dev

Sortable Drag List

Reorder a compact list with native HTML5 drag events and an accessible keyboard fallback.

Open in Lab
html css javascript react
Targets: TS JS HTML React

Code

Sortable Drag List

Reorder a compact list with native HTML5 drag events and an accessible keyboard fallback.

Support notes

Native HTML5 DnD covers desktop semantics while Pointer Events handle touch-friendly reorder surfaces. Add a persistence callback where the demo updates the DOM.

Included demo

  • Vanilla HTML, CSS, and JavaScript with zero external dependencies.
  • React equivalent using the same interaction model.
  • A Lab route for trying the behavior in isolation.

Integration checklist

Keep state updates separate from presentation, preserve semantic labels, and add persistence or server callbacks at the boundary where your product needs them.