Xzero UI
Pro library

Reorderable list

Organize items with direct drag and drop.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/reorderable-list
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/reorderable-list

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { useState } from "react";
import { ReorderableList } from "@/components/xzero/reorderable-list/reorderable-list";

export function Priorities() {
  const [items, setItems] = useState([
    { id: "a", title: "Ship pricing page", detail: "Due Friday" },
    { id: "b", title: "Fix login redirect" },
    { id: "c", title: "Write changelog" },
  ]);
  return <ReorderableList items={items} onReorder={setItems} label="Priorities" />;
}

API reference

ReorderableList

A vertical list reordered by dragging a grip handle or with arrow keys.

PropTypeDefaultDescription
items (required){ id: string; title: string; detail?: string }[]–Items in their current order.
onReorder (required)(items: ReorderableItem[]) => void–Called with the new order on drag or keyboard move.
labelstring"Reorder items"Accessible name for the list.

Keyboard interactions

KeysAction
ArrowUp / ArrowDownOn a handle, moves that item one place up or down.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in tables

Guidance for AI tools

Reorderable list: Organize items with direct drag and drop. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components