{"id":19093168,"url":"https://github.com/ufocoder/tiny-sortable-list","last_synced_at":"2026-03-16T19:02:48.340Z","repository":{"id":47478040,"uuid":"398825430","full_name":"ufocoder/tiny-sortable-list","owner":"ufocoder","description":"Tiny react component for sortable list","archived":false,"fork":false,"pushed_at":"2023-09-24T16:28:05.000Z","size":3352,"stargazers_count":13,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T12:08:11.389Z","etag":null,"topics":["drag-and-drop","hacktoberfest","react","sortable-lists"],"latest_commit_sha":null,"homepage":"","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/ufocoder.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":"2021-08-22T14:52:50.000Z","updated_at":"2024-02-14T21:36:51.000Z","dependencies_parsed_at":"2024-11-09T03:24:45.448Z","dependency_job_id":"0eee4983-99df-4f75-8eb8-88b16940e293","html_url":"https://github.com/ufocoder/tiny-sortable-list","commit_stats":null,"previous_names":["ufocoder/tiny-sortable-list"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufocoder%2Ftiny-sortable-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufocoder%2Ftiny-sortable-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufocoder%2Ftiny-sortable-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ufocoder%2Ftiny-sortable-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ufocoder","download_url":"https://codeload.github.com/ufocoder/tiny-sortable-list/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251702604,"owners_count":21630051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["drag-and-drop","hacktoberfest","react","sortable-lists"],"created_at":"2024-11-09T03:23:31.817Z","updated_at":"2026-03-16T19:02:48.306Z","avatar_url":"https://github.com/ufocoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Tiny sortable list\n==================\n\n![Build](https://github.com/ufocoder/tiny-sortable-list/actions/workflows/build.yml/badge.svg)\n\nReact component for sortable list based on HTML [Drag and Drop API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API)\n\n\n## Features\n\n- No dependencies\n- Mobile touch support\n- Horizonal and vertical lists\n\n## Usage\n\nMinimal working example\n\n```typescript\nimport { useState } from 'react'\nimport { SortableList, SortableItemProps } from 'tiny-sortable-list'\n\ninterface Item {\n  title: string\n}\n\nconst itemStyle = {\n  padding: '20px 10px',\n  background: 'white',\n  border: '2px black solid'\n};\n\nfunction ItemVerticalComponent(props: SortableItemProps\u003cItem\u003e) {\n  const { item, isDragged, isDragItemInsertAfter, isDragItemInsertBefore } = props\n\n  return (\n    \u003cdiv\n      style={{\n        ...itemStyle,\n        opacity: isDragged ? '0.3' : undefined,\n        borderTopColor: isDragItemInsertBefore ? 'yellow' : 'black',\n        borderBottomColor: isDragItemInsertAfter ? 'yellow' : 'black',\n      }}\u003e\n        {item.title}\n    \u003c/div\u003e\n  )\n}\n\nfunction App() {\n  const [items, setItems] = useState\u003cItem[]\u003e([\n    { title: 'item #1'},\n    { title: 'item #2'},\n    { title: 'item #3'},\n    { title: 'item #4'},\n    { title: 'item #5'},\n  ])\n\n  return (\n    \u003cSortableList items={items} setItems={setItems}\u003e\n      {props =\u003e \u003cItemVerticalComponent {...props} /\u003e}\n    \u003c/SortableList\u003e\n  )\n};\n```\n\n## Demo\n\n![demo](./demo.gif)\n\n## Note\n\nComponent use [dragdroptouch](https://github.com/Bernardo-Castilho/dragdroptouch) pollyfill source under the hood\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fufocoder%2Ftiny-sortable-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fufocoder%2Ftiny-sortable-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fufocoder%2Ftiny-sortable-list/lists"}