{"id":21148805,"url":"https://github.com/megaputer/react-redrag","last_synced_at":"2025-03-14T14:13:57.272Z","repository":{"id":97267872,"uuid":"118371980","full_name":"Megaputer/react-redrag","owner":"Megaputer","description":"Draggable, Droppable, and Sortable components for React","archived":false,"fork":false,"pushed_at":"2023-07-11T13:25:53.000Z","size":210,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T07:43:53.679Z","etag":null,"topics":["drag-and-drop","draggable","droppable","react","sortable"],"latest_commit_sha":null,"homepage":"https://megaputer.github.io/react-redrag/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Megaputer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-01-21T20:40:12.000Z","updated_at":"2019-12-23T07:14:32.000Z","dependencies_parsed_at":"2024-11-20T10:27:43.175Z","dependency_job_id":"ebd84748-6fbf-4e46-89d4-2077fa3521cc","html_url":"https://github.com/Megaputer/react-redrag","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaputer%2Freact-redrag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaputer%2Freact-redrag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaputer%2Freact-redrag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Megaputer%2Freact-redrag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Megaputer","download_url":"https://codeload.github.com/Megaputer/react-redrag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243589333,"owners_count":20315471,"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","draggable","droppable","react","sortable"],"created_at":"2024-11-20T09:29:10.964Z","updated_at":"2025-03-14T14:13:57.242Z","avatar_url":"https://github.com/Megaputer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-redrag\r\n\r\nYes, another one library to drag and drop. It written in [Typescript](http://www.typescriptlang.org/) for [React](https://facebook.github.io/react/) and containing `Draggable`, `Droppable` and `Sortable` components. Drag and Drop should be simple and pleasant!\r\n\r\n## Example\r\n\r\n[Basic usage examples.](https://megaputer.github.io/react-redrag/)\r\n\r\n## API\r\n\r\n#### `Draggable`\r\n\r\nDrag source wrapper. May be used without any Droppable. Do not unmount component while dragging!\r\n\r\n```typescript\r\ninterface DraggableProps {\r\n  /**\r\n   * Type (identifier) of dragged object. If not defined, `Draggable` doesn't interact with any Droppable.\r\n   */\r\n  type?: DraggedType;\r\n  /**\r\n   * Element that shown while dragging near the mouse. If not defined, children will be shown.\r\n   */\r\n  dragLayer?: React.ReactElement\u003cany\u003e;\r\n  /**\r\n   * Data attached to draggable object. This data can be accessed by DndEvent handlers.\r\n   */\r\n  dragData?: any;\r\n  /**\r\n   * Disables shifting drag layer.\r\n   * Shift value is difference between cursor position and left top point of the dragged element.\r\n   */\r\n  disableShift?: boolean;\r\n  /**\r\n   * Specifies the drag threshold in pixels.\r\n   */\r\n  dragThreshold?: number;\r\n  /**\r\n   * Called when drag started.\r\n   */\r\n  onStart?: DndHandler;\r\n  /**\r\n   * Called while dragging.\r\n   */\r\n  onDrag?: DndHandler;\r\n  /**\r\n   * Called when a drag ends.\r\n   */\r\n  onEnd?: DndHandler;\r\n}\r\n```\r\n\r\n#### `Droppable`\r\n\r\nDrop target wrapper.\r\n\r\n```typescript\r\ninterface DroppableProps {\r\n  /**\r\n   * Types (identifiers) that can accept Droppable. Callbacks will fire when `types` are equal.\r\n   */\r\n  type: DraggedType | Array\u003cDraggedType\u003e;\r\n  /**\r\n   * Custom data attached to droppable object.\r\n   */\r\n  dropData?: any;\r\n  /**\r\n   * Called when a mouse is moved over the target.\r\n   */\r\n  onEnter?: DndHandler;\r\n  /**\r\n   * Called when mouse leaves target.\r\n   */\r\n  onLeave?: DndHandler;\r\n  /**\r\n   * Called when a mouse is moved over the target.\r\n   */\r\n  onDragOver?: DndHandler;\r\n  /**\r\n   * Called when drop happens.\r\n   */\r\n  onDrop?: DndHandler;\r\n}\r\n```\r\n\r\n#### `DndEvent`\r\n\r\nDrag \u0026 drop event\r\n\r\n```typescript\r\ninterface DndEvent {\r\n  /**\r\n   * Type of dragged object, if not defined Draggable doesn't interact with Droppable\r\n   */\r\n  type?: DraggedType;\r\n  pageX: number;\r\n  pageY: number;\r\n  clientX: number;\r\n  clientY: number;\r\n  target: EventTarget;\r\n  deltaX?: number;\r\n  deltaY?: number;\r\n  dragData?: any;\r\n  dropTarget?: Droppable;\r\n  ctrlKey?: boolean;\r\n  shiftKey?: boolean;\r\n}\r\n```\r\n\r\n## `Sortable`\r\n\r\nHelper component which able to reorder children.\r\n\r\n```typescript\r\nexport interface SortableProps extends React.HTMLAttributes\u003cHTMLDivElement\u003e {\r\n  /**\r\n   * Make moved element invisible. As a dragged layer will be used clone of that element.\r\n   */\r\n  hideDragged?: boolean;\r\n  /**\r\n   * Provide custom `Draggable`. In that case each child must be ready to accept `DraggableProps`.\r\n   */\r\n  customDraggable?: boolean;\r\n  /**\r\n   * Called when dragging starts.\r\n   */\r\n  onSortStart?: () =\u003e void;\r\n  /**\r\n   * Called when the drag is finished without any reorder.\r\n   */\r\n  onSortCancel?: () =\u003e void;\r\n  /**\r\n   * Called when user has made some reorder.\r\n   */\r\n  onSortEnd: (from: number, to: number) =\u003e void;\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegaputer%2Freact-redrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegaputer%2Freact-redrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegaputer%2Freact-redrag/lists"}