Vibary.ai
← Vibe Coding

Field Reorder Drag

A row lifts onto a shadow while the rows around it part to make room — by pointer, and by arrow key from a grabbed state.

formspremiumfriendlyinteraction · finite · advanced · ~0.3s
Interactive · click to play
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

425 lines · react + motion only
import {
  useId,
  useState,
  type KeyboardEvent as ReactKeyboardEvent,
  type PointerEvent as ReactPointerEvent,
} from "react";
import { Reorder, useDragControls, useReducedMotion } from "motion/react";

About this pattern

Reordering is the interaction people are most likely to get stuck in, so the row being moved has to look picked up and the gap has to open before the drop, not after it. The lift is shadow and surface only — never scale, because the row is mostly text and text that grows under a finger reads as a bug rather than as depth — and the rows on either side spring apart and close once, without shuffling to a stop. The keyboard gets the identical motion rather than a lesser version of it: the handle is a real button that grabs on space, moves on the arrow keys, drops on escape, and every move is spoken through a live region so the reorder is not a silent one.

Form builder field orderReorderable settings rowsPriority or ranking listColumn arrangement panel

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • Add a supplierTwo fields now, the rest later
    Legal name
    Ridgeline Supply Co.
    Country
    Sweden
    VAT number
    SE556031820101
    Save supplier
    Form

    A row raised on a shadow while its neighbours slide to fill the space.

Related patterns