{"id":43916878,"url":"https://github.com/zooniverse/drag-reorderable","last_synced_at":"2026-02-06T21:34:55.120Z","repository":{"id":4968186,"uuid":"43179564","full_name":"zooniverse/drag-reorderable","owner":"zooniverse","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-29T11:13:10.000Z","size":22,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-29T12:31:22.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zooniverse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-25T23:05:26.000Z","updated_at":"2022-01-05T11:32:31.000Z","dependencies_parsed_at":"2024-04-29T12:31:12.483Z","dependency_job_id":"db7885a8-8499-41fe-a3f6-e216717d886f","html_url":"https://github.com/zooniverse/drag-reorderable","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zooniverse/drag-reorderable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fdrag-reorderable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fdrag-reorderable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fdrag-reorderable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fdrag-reorderable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zooniverse","download_url":"https://codeload.github.com/zooniverse/drag-reorderable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fdrag-reorderable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29177554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-06T21:34:55.036Z","updated_at":"2026-02-06T21:34:55.100Z","avatar_url":"https://github.com/zooniverse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DragReorderable\n\nThis is a React component for simple reordering of items in an array.\n\nIt takes the following props:\n\n* `tag`: The container tag to render. Defaults to `\"div\"`.\n\n* `items`: The array of items you want to be reorderable.\n\n* `render`: The function to render each item. It should return a React element. Make sure it's got a `key` prop!\n\n* `onChange`: The function to call when an item has been successfully dragged and dropped.\n\n`display: block` elements can be dragged vertically, `inline` elements horizontally.\n\nWhile dragging, the root document element will get a `data-drag-reorderable-dragging` attribute, the container will get a `data-dragging` attribute, and the item being dragged will get a `data-being-dragged` attribute.\n\n## Example\n\nhttp://zooniverse.github.io/drag-reorderable/example.html\n\n```jsx\n  const Whatever = React.createClass({\n    getInitialState() {\n      return {\n        things: [\n          {id: 0, content: 'Hello'},\n          {id: 1, content: 'World'},\n          {id: 2, content: 'Hola'},\n          {id: 3, content: 'Mundo'}\n        ]\n      };\n    },\n\n    render() {\n      return (\n        \u003cDragReorderable\n          tag=\"ul\"\n          items={this.state.things}\n          render={this.renderThing}\n          onChange={this.handleThingsReorder}\n        /\u003e\n      };\n    },\n\n    renderThing(thing) {\n      return (\n        \u003cli key={thing.id}\u003e\n          \u003cp\u003eThe thing is: \u003ccode\u003e{thing.content}\u003c/code\u003e.\u003c/p\u003e\n        \u003c/li\u003e\n      );\n    },\n\n    handleThingsReorder(newThings) {\n      this.setState({\n        things: newThings\n      });\n    }\n  });\n```\n\n## TODO:\n\n* Tests!\n\n* Touch event handling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzooniverse%2Fdrag-reorderable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzooniverse%2Fdrag-reorderable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzooniverse%2Fdrag-reorderable/lists"}