Skip to content
/ draggable Public
forked from Shopify/draggable

The JavaScript Drag & Drop library your grand-grandparents warned you about.

License

Notifications You must be signed in to change notification settings

hnrq/draggable

 
 

Repository files navigation

npm version codecov

Get complete control over drag and drop behaviour with Draggable! Draggable abstracts native browser events into a comprehensive API to create a custom drag and drop experience. Draggable comes with additional modules: Sortable, Droppable, Swappable. Draggable itself does not perform any sorting behaviour while dragging, but does the heavy lifting, e.g. creates mirror, emits events, manages sensor events, makes elements draggable.

The additional modules are built on top of Draggable and therefore provide a similar API interface, for more information read the documentation below.

Features

  • Works with native drag, mouse, touch and force touch events
  • Can extend dragging behaviour by hooking into draggables event life cycle
  • Can extend drag detection by adding sensors to draggable
  • The library is targeted ES6 first

Table of Contents

Install

You can install the library via pnpm.

pnpm install @hnrq/draggable --save

Browser Compatibility

Chrome Firefox Opera Safari Edge
Latest ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔

Documentation

You can find the documentation for each module within their respective directories.

Running examples

To run the examples project locally, simply run the following from the examples folder:

pnpm build && pnpm dev

Contributing

Contributions are more than welcome, the code base is still new and needs more love. For more information, please checkout CONTRIBUTING.md.

About

The JavaScript Drag & Drop library your grand-grandparents warned you about.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.9%
  • JavaScript 0.1%