{"id":24511720,"url":"https://github.com/devnax/react-movebox","last_synced_at":"2025-10-26T19:32:31.094Z","repository":{"id":62645438,"uuid":"561363557","full_name":"devnax/react-movebox","owner":"devnax","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-03T15:29:20.000Z","size":294,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T02:34:13.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devnax.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}},"created_at":"2022-11-03T14:29:10.000Z","updated_at":"2025-02-09T09:21:42.000Z","dependencies_parsed_at":"2022-11-04T04:32:25.088Z","dependency_job_id":null,"html_url":"https://github.com/devnax/react-movebox","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/devnax%2Freact-movebox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnax%2Freact-movebox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnax%2Freact-movebox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnax%2Freact-movebox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devnax","download_url":"https://codeload.github.com/devnax/react-movebox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713387,"owners_count":20335566,"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":[],"created_at":"2025-01-22T00:40:55.487Z","updated_at":"2025-10-26T19:32:30.992Z","avatar_url":"https://github.com/devnax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Move any element\n\n## Use\n\n```js\nimport useMovebox from 'react-movebox'\n\nconst App = () =\u003e {\n  const [refs, state] = useMovebox({\n    defaultStyle: false, // optional\n   boundary: { // optional\n      width: 500,\n      height: 500\n   },\n    start: (s) =\u003e {\n      console.log(s);\n    },\n    moving: (s) =\u003e {\n      console.log(state);\n    },\n    end: (s) =\u003e {\n      console.log(s);\n    },\n  })\n  \n  return (\n    \u003cdiv\n      ref={refs.boundaryRef}\n      style={{\n        width: 500,\n        height: 500,\n        background: \"green\",\n        marginLeft: 100,\n        marginTop: 100\n      }}\n    \u003e\n      \u003cdiv\n      ref={refs.boxRef}\n      style={{\n        width: 20,\n        height: 20,\n        borderRadius: 20,\n        backgroundColor: \"red\",\n        position: \"fixed\",\n        zIndex: 9999\n      }}\n    \u003e\n      \n    \u003c/div\u003e\n    \u003c/div\u003e\n  );\n};\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'));\n\n```\n\n\n## Arguments\n\n```js\nconst Args = {\n   defaultStyle?: boolean;\n   boundary?: {\n      width: number;\n      height: number;\n   };\n   start?: (state: StateProps) =\u003e void;\n   end?: (state: StateProps) =\u003e void;\n   moving?: (state: StateProps) =\u003e void;\n}\n\n```\n\n## State Props\n```js\n\nconst StateProps = {\n   pos: {\n      left: number,\n      top: number\n   },\n   initX: number,\n   initY: number,\n   height: number,\n   width: number,\n   isMouseDown: boolean,\n}\n\n```\n\n\n\n## Refs\n\n```\nrefs = {\n  boxRef: any,\n  handlerRef: any,\n  boundaryRef: any\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnax%2Freact-movebox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevnax%2Freact-movebox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnax%2Freact-movebox/lists"}