Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

draggable

> 编程语言
Open source

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

18.5K stars0 likes3 views
WebsiteGitHub

About

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

Development

Draggable is no longer maintained by its original authors. Maintenance of this repo has been passed on to new collaborators and is no longer worked on by anyone at Shopify.

We are still looking for more maintainers! If anyone is interested in answering / triaging issues, reviewing / rejecting / approving PRs, and authoring code for bug fixes / new features — please send an email to max.hoffmann (at) shopify (dot) com. You may be asked a few questions before obtaining collaboration permission, but if everything checks out, we will happily add you as a collaborator.


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
  • Documentation
  • Contributing
  • Roadmap
  • Copyright

Install

You can install the library via npm.

bash
npm install @shopify/draggable --save

or via yarn:

bash
yarn add @shopify/draggable

or via CDN

…

Browser Compatibility

Check the "browserlist" property in package.json for more info

Last 3 versions ✔ Last 3 versions ✔ Last 3 versions ✔ Last 3 versions ✔ Last 3 versions ✔

Documentation

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

  • Draggable
    • DragEvent
    • DraggableEvent
    • Plugins
      • Announcement
      • Focusable
      • Mirror
      • MirrorEvent
      • Scrollable
    • Sensors
      • DragSensor
      • ForceTouchSensor
      • MouseSensor
      • Sensor
      • SensorEvent
      • TouchSensor
  • Droppable
    • DroppableEvent
  • Plugins
    • Collidable
    • ResizeMirror
    • Snappable
    • SwapAnimation
    • SortAnimation
  • Sortable
    • SortableEvent
  • Swappable
    • SwappableEvent

TypeScript

Draggable includes TypeScript definitions.

Documentation

Running examples

To run the examples project locally, simply run the following from the draggable root:

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

Related resources

  • Ember CLI Shim on Github by @timrourke
  • Ember CLI Shim on NPM by @timrourke

Copyright

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

Issues· 171 open

View all issuesOpen on GitHub
  • #669

    Boa noite

    Updated Apr 11, 2026
  • #539

    Why Sensors trigger events in source container?

    Updated Nov 6, 2025
  • #535

    The mirror element created at the wrong place when using flexbox

    Updated Nov 3, 2025
  • #536

    Does it make sense to replace AbstractEvent with CustomEvent?

    Updated Nov 3, 2025
  • #555

    Sortable with fixed Layout

    Updated Nov 3, 2025
  • #594

    [BUG] - Multiple Container Sortable Bug on touch devices

    Updated Nov 3, 2025
  • #601

    Duplicate Mirror gets created on iOS Safari if the draggable element contains a link

    Updated Nov 2, 2025
  • #603

    Swappable:swap cancel async

    Updated Nov 2, 2025
  • #606

    Question - Sortable and Snappable

    Updated Nov 2, 2025
  • #626

    Draggable.Sortable on Table Rows Using rowspan

    Updated Oct 30, 2025

> Tags

JavaScriptdrag-and-dropdraggablees6javascript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言