GithubHelp home page GithubHelp logo

leiroc / draggable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shopify/draggable

0.0 2.0 0.0 3.91 MB

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

Home Page: https://shopify.github.io/draggable

License: MIT License

JavaScript 100.00%

draggable's Introduction

CircleCI npm version codecov Greenkeeper badge

Currently in beta! While Draggable is very close to a full release, the API is still subject to change. We keep an updated CHANGELOG with every release, so when upgrading from a previous version, please check and see what has changed.

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 npm.

npm install @shopify/draggable --save

or via yarn:

yarn add @shopify/draggable

or via CDN

<!-- Entire bundle -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/[email protected]/lib/draggable.bundle.js"></script>
<!-- legacy bundle for older browsers (IE11) -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/[email protected]/lib/draggable.bundle.legacy.js"></script>
<!-- Draggable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/[email protected]/lib/draggable.js"></script>
<!-- Sortable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/[email protected]/lib/sortable.js"></script>
<!-- Droppable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/[email protected]/lib/droppable.js"></script>
<!-- Swappable only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/[email protected]/lib/swappable.js"></script>
<!-- Plugins only -->
<script src="https://cdn.jsdelivr.net/npm/@shopify/[email protected]/lib/plugins.js"></script>

Browser Compatibility

Chrome Firefox IE Opera Safari Edge
Latest ✔ Latest ✔ 11+ ✔ Latest ✔ Latest ✔ Latest ✔

Bundle sizes

Package name ES6 bundle sizes ES5 bundle sizes
draggable.bundle.js ~11kb ~19.2kb
draggable.bundle.legacy.js ~19.2kb ~25.63kb
draggable.js ~8.06kb ~15.36kb
sortable.js ~8.93kb ~16.51kb
swappable.js ~8.56kb ~16.14kb
droppable.js ~8.8kb ~16.55kb
plugins.js ~2.37kb ~8.76kb
plugins/collidable.js ~1.45kb ~7.81kb
plugins/snappable.js ~1.19kb ~6.94kb
plugins/swap-animation.js ~1kb ~6.65kb

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 draggable root:

yarn && yarn start

This will start a server that hosts the contents of examples/. It also watches for file changes from both src/ and examples/src and reloads the browser.

Contributing

Contributions are more than welcome, the code base is still new and needs more love.

For more information, please checkout the contributing document.

Roadmap

We are currently working on v1.0.0-beta.8. Check out the project board to see tasks and follow progress on the release. Any Pull Requests should be pointed against the feature branch v1.0.0-beta.8.

Related resources

Copyright

Copyright (c) 2018 Shopify. See LICENSE.md for further details.

draggable's People

Contributors

beefchimi avatar bkd705 avatar bpscott avatar bt4r9 avatar danieldunderfelt avatar greenkeeper[bot] avatar hosmelq avatar jackjennings avatar jkling38 avatar josh18 avatar lukasdrgon avatar nikolasklein avatar oreoz avatar promisetochi avatar pywebdesign avatar randym avatar richardkmichael avatar samueljmurray avatar sdgandhi avatar smileytechguy avatar solomonhawk avatar stefanmiodrag avatar timrourke avatar tmlayton avatar tsov avatar wadlieb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.