{"id":16811629,"url":"https://github.com/dylanvann/ant-design-draggable-modal","last_synced_at":"2025-04-05T05:06:21.984Z","repository":{"id":46302904,"uuid":"170174296","full_name":"DylanVann/ant-design-draggable-modal","owner":"DylanVann","description":"The Modal from Ant Design, draggable.","archived":false,"fork":false,"pushed_at":"2024-05-23T08:26:39.000Z","size":3594,"stargazers_count":169,"open_issues_count":14,"forks_count":52,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T04:07:45.707Z","etag":null,"topics":["ant-design","draggable","hacktoberfest","modal","react"],"latest_commit_sha":null,"homepage":"https://ant-design-draggable-modal.netlify.com","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/DylanVann.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":"2019-02-11T17:50:22.000Z","updated_at":"2025-02-28T09:02:05.000Z","dependencies_parsed_at":"2024-06-18T14:40:22.327Z","dependency_job_id":"a00f97fb-2167-4e18-928b-5d95981f5775","html_url":"https://github.com/DylanVann/ant-design-draggable-modal","commit_stats":{"total_commits":94,"total_committers":2,"mean_commits":47.0,"dds":"0.010638297872340385","last_synced_commit":"7bbfcdd74e6921a64f198b8fbf4df5236d3b2ed1"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DylanVann%2Fant-design-draggable-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DylanVann%2Fant-design-draggable-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DylanVann%2Fant-design-draggable-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DylanVann%2Fant-design-draggable-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DylanVann","download_url":"https://codeload.github.com/DylanVann/ant-design-draggable-modal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289427,"owners_count":20914464,"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":["ant-design","draggable","hacktoberfest","modal","react"],"created_at":"2024-10-13T10:19:17.989Z","updated_at":"2025-04-05T05:06:21.962Z","avatar_url":"https://github.com/DylanVann.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eAnt Design Draggable Modal\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nModal from Ant Design, draggable.\n\n[![Version][version-badge]][package]\n[![Downloads][downloads-badge]][npmtrends]\n[![BundlePhobia](https://img.shields.io/bundlephobia/minzip/ant-design-draggable-modal.svg?style=flat-square)](https://bundlephobia.com/result?p=ant-design-draggable-modal)\n[![MIT License][license-badge]][license]\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n[![Tweet][twitter-badge]][twitter]\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://distracted-hugle-66cb55.netlify.com/\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/1537615/52606003-06002180-2e3f-11e9-83f2-21fc6212924a.gif\" alt=\"Example of ant-design-draggable-modal.\"\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\n## 🌎 [Example](https://ant-design-draggable-modal.netlify.app/)\n\n## ✨ Features\n\n-   [x] Drag with title bar.\n-   [x] Resize with handle.\n-   [x] Keep in bounds.\n    -   [x] During drag.\n    -   [x] During resize.\n    -   [x] During resize window.\n-   [x] Multiple modals with managed `zIndex`.\n-   [x] Open from center.\n-   [ ] Better API for using as a controlled component.\n-   [ ] Open from quadrants.\n-   [ ] Better escape key management.\n-   [ ] Resize with option key.\n\n## 📦 Install\n\n```bash\nyarn add ant-design-draggable-modal\n```\n\nNOTE: You must use `react@16.8.0` and `react-dom@16.8.0` or higher.\n\n## 🔨 Usage\n\n```tsx\nimport React, { useState, useCallback } from 'react'\nimport { Button } from 'antd'\nimport { DraggableModal, DraggableModalProvider } from 'ant-design-draggable-modal'\nimport 'antd/dist/antd.css'\nimport 'ant-design-draggable-modal/dist/index.css'\n\nconst ModalWithButton = () =\u003e {\n    const [visible, setVisible] = useState(false)\n    const onOk = useCallback(() =\u003e setVisible(true), [])\n    const onCancel = useCallback(() =\u003e setVisible(false), [])\n    return (\n        \u003c\u003e\n            \u003cButton onClick={onOk}\u003eOpen\u003c/Button\u003e\n            \u003cDraggableModal visible={visible} onOk={onOk} onCancel={onCancel}\u003e\n                Body text.\n            \u003c/DraggableModal\u003e\n        \u003c/\u003e\n    )\n}\n\n// DraggableModalProvider manages the zIndex\n// of DraggableModals rendered beneath it.\nconst App = () =\u003e (\n    \u003cDraggableModalProvider\u003e\n        \u003cModalWithButton /\u003e\n        \u003cModalWithButton /\u003e\n        \u003cModalWithButton /\u003e\n    \u003c/DraggableModalProvider\u003e\n)\n```\n\n## ⚠️ User Experience Warning\n\nYou should probably try to design your app not to need to use this, apps should usually not be window managers.\n\n## License\n\nMIT © [DylanVann](https://github.com/DylanVann)\n\n\u003c!--\nLinks:\n--\u003e\n\n\u003c!-- prettier-ignore-start --\u003e\n\n[downloads-badge]: https://img.shields.io/npm/dm/ant-design-draggable-modal.svg?style=flat-square\n[npmtrends]: http://www.npmtrends.com/ant-design-draggable-modal\n[package]: https://www.npmjs.com/package/ant-design-draggable-modal\n[version-badge]: https://img.shields.io/npm/v/ant-design-draggable-modal.svg?style=flat-square\n[license-badge]: https://img.shields.io/npm/l/ant-design-draggable-modal.svg?style=flat-square\n[license]: https://github.com/dylanvann/ant-design-draggable-modal/blob/master/LICENSE\n[twitter]: https://twitter.com/home?status=Check%20out%20ant-design-draggable-modal%20by%20%40atomarranger%20https%3A//github.com/DylanVann/ant-design-draggable-modal\n[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/DylanVann/ant-design-draggable-modal.svg?style=social\n[github-watch-badge]: https://img.shields.io/github/watchers/dylanvann/ant-design-draggable-modal.svg?style=social\n[github-watch]: https://github.com/dylanvann/ant-design-draggable-modal/watchers\n[github-star-badge]: https://img.shields.io/github/stars/dylanvann/ant-design-draggable-modal.svg?style=social\n[github-star]: https://github.com/dylanvann/ant-design-draggable-modal/stargazers\n\n\u003c!-- prettier-ignore-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanvann%2Fant-design-draggable-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylanvann%2Fant-design-draggable-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanvann%2Fant-design-draggable-modal/lists"}