Reorder Readback

Reorder Readback is a copy-paste React component that stops slipped drag reordered payment fallbacks before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/reorder-readback
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 2 extra npm packages
  • A11y guidance in docs

StopsSlipped drag reordered payment fallbacks

Was this component page useful?

How do I install Reorder Readback?

pnpm dlx shadcn@latest add @bollard/reorder-readback

The files land in your project. They're yours to edit.

How do I use Reorder Readback in React?

reorder-readback-usage.tsx
import { ReorderReadback, type ReorderItem } from "@/components/ui/reorder-readback"

<ReorderReadback
  label="Payment fallback order"
  items={gateways}
  value={order}
  onValueChange={setOrder}
  baseline={saved}
  describePosition={(i, total) => (i === 1 ? "the first gateway tried for cards" : i === total - 1 ? "the last resort" : `fallback ${i}`)}
/>

What input mistakes does Reorder Readback catch?

  • Every move, read back with what the new position means
  • Moves that would push a pinned row aside, refused with a reason
  • Rows moved since the last saved baseline
  • Touch scrolling that would start a drag (drag only from the grip)

What props does Reorder Readback accept?

ReorderReadback props
PropTypeDefault
items* (required)

Rows to order, each with an id and a name.

ReorderItem[]—
value

Order as a list of ids (controlled).

string[]—
defaultValue

Initial order when uncontrolled. Defaults to the order of `items`.

string[]—
onValueChange

Fires once per finished move (on drop, never mid-drag), with the new order.

(order: string[]) => void—
baseline

The last saved order. Rows that moved since show ↑/↓ and the header offers Revert.

string[]—
describePosition

What a place means, so the readback says the consequence: `(i) => i === 0 ? "tried first" : ""`.

(index: number, total: number) => string—
formatPosition

Position wording, "3rd" by default.

(index: number) => stringordinal
label

Accessible name of the list.

string"Order"
messages

Visible text, all overridable.

Partial<typeof REORDER_READBACK_MESSAGES>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Reorder Readback accessible?

  • Space picks up, arrow keys move, Space drops and Escape cancels; instructions linked via aria-describedby
  • Move-up/down buttons on every row give a non-drag alternative (WCAG 2.2 SC 2.5.7)
  • One role=status region with debounced announcements
  • Grip has an aria-label and aria-pressed; pinned rows use aria-disabled with a lock icon
  • Animations respect reduced motion; focus returns to the grip after moves and undo

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Consequence text comes from your describePosition; without it only positions are read back
  • Does not save; persist the order yourself (normalizeOrder in reorder.ts can run on the server)

What expensive mistakes does Reorder Readback stop?

Slipped drag reordered payment fallbacks

Also known as

drag to reorder · sortable · dnd-kit · priority list · reorder · payment gateway order · razorpay · drag handle

What dependencies does Reorder Readback require?

Reorder Readback facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameReorder Readback
Registry identifier@bollard/reorder-readback
Install commandnpx shadcn@latest add @bollard/reorder-readback
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react, motion
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Reorder Readback

What form validation mistake does Reorder Readback catch?

Reorder Readback prevents slipped drag reordered payment fallbacks. Reads back every reorder with its consequence and an Undo, so a slipped drag doesn't silently change priorities, fallbacks or steps. Catches: Every move, read back with what the new position means, Moves that would push a pinned row aside, refused with a reason, Rows moved since the last saved baseline, Touch scrolling that would start a drag (drag only from the grip). Limitation: validate reorder-readback schemas on backend.

How do I install reorder-readback with shadcn?

Run `npx shadcn@latest add @bollard/reorder-readback`. Sources added: registry/default/reorder-readback/reorder-readback.tsx, registry/default/reorder-readback/reorder.ts. Package requirements: lucide-react, motion.

What props customize Reorder Readback?

Reorder Readback accepts `items`, `value`, `defaultValue`, `onValueChange`, `baseline`. Configures drag to reorder, sortable, dnd-kit behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of reorder-readback?

Consequence text comes from your describePosition; without it only positions are read back. Does not save; persist the order yourself (normalizeOrder in reorder.ts can run on the server) Server requirement: backend verification for reorder-readback.

How does Reorder Readback meet accessibility guidelines?

Space picks up, arrow keys move, Space drops and Escape cancels; instructions linked via aria-describedby. Move-up/down buttons on every row give a non-drag alternative (WCAG 2.2 SC 2.5.7). One role=status region with debounced announcements. Grip has an aria-label and aria-pressed; pinned rows use aria-disabled with a lock icon. Animations respect reduced motion; focus returns to the grip after moves and undo. Minimizes errors: drag reordered list by mistake, priority order changed accidentally.

Which components pair with Reorder Readback?