{"id":16125669,"url":"https://github.com/dy/draggy","last_synced_at":"2026-01-23T09:18:16.455Z","repository":{"id":19853029,"uuid":"23115351","full_name":"dy/draggy","owner":"dy","description":"Draggable provider","archived":false,"fork":false,"pushed_at":"2024-10-18T19:35:40.000Z","size":3193,"stargazers_count":25,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-04T15:07:22.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dy.github.io/draggy","language":"JavaScript","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/dy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2014-08-19T15:27:57.000Z","updated_at":"2024-11-06T22:59:28.000Z","dependencies_parsed_at":"2024-10-21T18:32:45.339Z","dependency_job_id":null,"html_url":"https://github.com/dy/draggy","commit_stats":{"total_commits":209,"total_committers":2,"mean_commits":104.5,"dds":0.004784688995215336,"last_synced_commit":"681c937326d862f26abd32c5b8e7b405dbda827b"},"previous_names":["dfcreative/draggy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fdraggy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fdraggy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fdraggy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fdraggy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dy","download_url":"https://codeload.github.com/dy/draggy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232797463,"owners_count":18577981,"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":"2024-10-09T21:30:33.169Z","updated_at":"2026-01-23T09:18:11.417Z","avatar_url":"https://github.com/dy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n\u003cimg src=\"https://cdn.rawgit.com/dy/draggy/design/logo.png\"/\u003e\n\nDraggy\n\n\u003ca href=\"/license\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/draggy.svg\"/\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n\nMake any element draggable. [Demo](https://dy.github.io/draggy).\n\n\n[![npm install draggy](https://nodei.co/npm/draggy.png?mini=true)](https://npmjs.org/package/draggy)\n\n```js\nimport Draggable from 'draggy';\n\n//make an element draggable\nvar el = document.querySelector('.my-element');\nvar draggy = new Draggable(el, {\n\trelease: true,\n\tsniper: false,\n\taxis: 'x'\n});\n\n//bind event handler\ndraggy.on('drag', function () {\n\t// ...\n});\n```\n\n\n## Options\n\n| Parameter | Default | Description |\n|---|:---:|---|\n| `axis` | `null` | Restrict movement by axis: `'x'`, `'y'` or `null`. |\n| `pin` | `[0,0, selfWidth, selfHeight]` | Defines a smaller area within the draggable element that stays within movement limits. Useful to restrict movement based on an inner shape rather than the full element. |\n| `precision` | `1` | Round position to that extent, in pixels. |\n| `css3` | `true` | Use `position` vs `translate3d` to place element. The first is more precise and reliable, the second is faster. |\n| `release` | `false` | Continue movement when user releases drag. |\n| `repeat` | `false` | Loop movement by one of axis: `'x'`, `'y'` or `'both'`. |\n| `sniper` | `true` | Slow down movement by pressing Ctrl/Cmd. |\n| `threshold` | `0` | A movement threshold required to start drag - whether an array, number or function. |\n| `within` | `document` | Restrict movement within the container. Pass `'parent'` to use parent node. |\n| `handle` | `self.element` | Use element or selector as a handle for drag. Clicking outside the handle is ignored. |\n| `cancel` | `undefined` | Ignore dragging started on the elements matching the selector. |\n| `droppable` | `undefined` | Selector, element or list of elements to detect droppable areas. For each drop element will be invoked `drop`, `dragover` and `dragout` events. |\n\n\n## Events\n\n| Name | Description |\n|---|---|\n| `dragstart` | Drag started. Called both on element/controller. |\n| `threshold` | Entered threshold mode. Called on controller. |\n| `drag` | Drag iteration. Called both on element/controller. |\n| `track` | Track movement. Called on controller. |\n| `release` | User released drag. Called on controller. |\n| `dragend` | Drag has completely finished. Called both on element/controller. |\n| `dragover` |  Called on self and on drop target. |\n| `dragout` |  Called on self and on drop target. |\n| `drop` |  Called on self and on drop target. |\n\n\n\n## What draggy is not\n\n* It doesn’t do ghost move, as it is not draggable behavior and can be implemented externally.\n* It doesn’t do mouse hiding on drag, as it can be done via callbacks.\n* It doesn’t init itself automatically - it's up to you to decide when to create/init draggable.\n* It doesn’t polyfill native draggable, as it targets to complete simple task of visual placement of element.\n\n## Alternatives\n\n* [interactjs](https://www.npmjs.com/package/interactjs)\n* [@shopify/draggable](https://www.npmjs.com/package/@shopify/draggable)\n* [draggabilly](https://www.npmjs.com/package/draggabilly)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fdraggy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdy%2Fdraggy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fdraggy/lists"}