Reorder list
Grab a handle and the row lifts out of its tray while the others part to make room. Near an edge the list scrolls for you, and the keyboard can do it all with spoken positions.
npx shadcn@latest add @uimaxxer/reorder-listPasskeysRun order
Run order
Run order
7 tasks, $2.43, 43 min
- Reproduce the flaky billing webhook test+0:00
- Patch retry logic in webhooks/stripe.ts+0:04
- Write regression tests for duplicate events+0:13
- Run the full suite on staging+0:20
- Update the incident note in docs/incidents+0:32
- Open the pull request for review+0:34
- Move invoice PDFs to the new bucket+0:35
Press Space to pick up. Use the arrow keys to move, Space to drop and Escape to cancel.
Reorder list is a Pro component
The demo and the docs are free. The source comes with Pro, through this page, the shadcn CLI and the MCP.
Usage
import { ReorderList } from "@/components/ui/reorder-list"
<ReorderList
aria-label="Run order"
items={tasks}
onReorder={setTasks}
getLabel={(t) => t.title}
renderItem={(t) => <span>{t.title}</span>}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| items | T[] (each with an id) | Controlled order. | |
| defaultItems | T[] | Initial order when uncontrolled. | |
| onReorder | (items: T[]) => void | Called with the new order on drop, and on each keyboard move. | |
| renderItem | (item: T, index: number) => ReactNode | The row's content, beside the handle. | |
| getLabel | (item: T) => string | Plain text for the handle's name and the announcements. | |
| aria-label | string | Names the list. | |
| maxHeight | number | Scroll inside the tray past this height; dragging near an edge auto-scrolls. |
Keyboard
- Space / Enter
- Pick up or drop
- ↑ ↓
- Move the picked-up row
- Home / End
- Move it to the top or bottom
- Escape
- Put it back where it started
Accessibility
- Each handle is a button named for its row, with aria-pressed while picked up and instructions in aria-describedby.
- Pick-up, every move, drop and cancel are announced with the position, for example 'position 3 of 7'.
- Only the handle starts a drag, so the row's own text and links still work with touch.