Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dflex/draggable

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dflex/draggable

> Draggable is a native component written in pure JS works for Web and Mobile

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80
increased by1500%
Maintainers
1
Weekly downloads
 
Created
Source

@dflex/draggable

Draggable is a native component written in pure JS works for Web and Mobile

npm install @dflex/draggable

show how dragabble works

DFlex draggable is the simplest solution to create JavaScript draggable elements. No need for special tutorial and thinking about implementation complexity or even migration to different technologies for different frameworks. It can be used with any JavaScript frameworks React, Vue, Angular.

API

import { store, Draggable } from "@dflex/draggable";

Registry

Register draggable element in draggable store:

store.register({ id: string, element: Node });

Draggable instance

Create draggable instance onmousedown:

const draggable = new Draggable(id: string, {x: event.clientX, y: event.clientY});

Move element onmousemove

draggable.dragAt(event.clientX, event.clientY);

End Dragging onmouseup

draggable.endDragging();
Examples

You can see full React template here.

Contributes feel free to apply PR for another frameworks.

Test

yarn test draggable

License

This package is licensed under the GPL-3.0 License

Keywords

FAQs

Package last updated on 19 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc