{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sortable-list-demo",
  "title": "Sortable List Demo",
  "description": "A worked example of Sortable List: A list reordered by dragging a handle, or from the keyboard without one, where every move is announced.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/sortable-list.json"
  ],
  "files": [
    {
      "path": "components/demos/sortable-list-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { SortableList } from \"@/registry/default/sortable-list/sortable-list\"\n\ntype Task = { id: string; name: string; note: string }\n\nconst initial: Task[] = [\n  { id: \"read\", name: \"Read the brief\", note: \"Twice, slowly\" },\n  { id: \"sketch\", name: \"Sketch three routes\", note: \"On paper\" },\n  { id: \"build\", name: \"Build the likely one\", note: \"Thin slice first\" },\n  { id: \"show\", name: \"Show someone\", note: \"Before it is finished\" },\n]\n\nexport function SortableListDemo() {\n  const [tasks, setTasks] = React.useState(initial)\n\n  return (\n    <div className=\"w-full max-w-md\">\n      <SortableList\n        items={tasks}\n        getKey={(task) => task.id}\n        getLabel={(task) => task.name}\n        onReorder={setTasks}\n        label=\"Tasks in order\"\n        renderItem={(task) => (\n          <div>\n            <p className=\"text-sm font-semibold\">{task.name}</p>\n            <p className=\"text-muted-foreground text-xs\">{task.note}</p>\n          </div>\n        )}\n      />\n      <p className=\"text-muted-foreground mt-3 text-xs\">\n        Drag a handle, or focus one and press space to lift it.\n      </p>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}