All examples

Reorder board

Drag rows to reorder them, or use the arrow keys on a focused row.

useReorder

Preparing the example…

How it works

  1. useReorder(items, setItems) returns a ref for each item. Attach it to any focusable element.
  2. While dragging, the other rows move out of the way; on release the list is written back through your state setter.
  3. Arrow keys move a focused row, so the same list works without a pointer.

More examples

Search

Type to search the documentation.