Skip to content

FLIP reorder

A sortable list. Pointer drag moves the row under your finger while the others glide aside using FLIP (measure first, measure last, invert, play) through the Web Animations API. The keyboard path picks a row up with Space, moves it with the arrow keys, Home and End, drops it with Space and cancels with Escape, and every step is written into a polite live region. Move, cancel and announcement text come from a pure reducer with unit tests. The announcements have not been tried with a screen reader. With reduced motion rows jump without animating.

  • FLIP
  • Web Animations API
  • Pointer Events
  • aria-live
  • prefers-reduced-motion

flip-reorder

Drag a row, or Tab to one, press Space to pick it up, move it with the arrow keys, and press Space to drop it. Escape puts it back.

Announcements appear here.

Usage

Drop it in

import
import { FlipReorderPanel } from "@/app/lib/components/flip-reorder";

Accessibility

Works with

Cursor
Reacts to where the pointer is, not just whether it's over the element.
Touch
Follows your finger while it's down, then settles a moment after you lift.
Keyboard
Focus lights it up the way the cursor does. Every action has a key.
Reduced motion
Nothing moves or springs. Colour still answers, without drifting.