🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

drag-react

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drag-react

React draggable component

1.1.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

React Draggable Component

A simple and lightweight component for making elements draggable.

Demo

stackblitz

Installation

$ npm install drag-react
# yarn add drag-react

Example

import { Draggable } from 'drag-react';

<Draggable>
  <div>My element is draggable now</div>
</Draggable>

Props

nametypedefaultdescription
childrenany-Some element
className?string'drag-react'Class name for drag wrapper
style?Object{ position: 'fixed', left: '10px', top: '10px', zIndex: 99999 , cursor: 'move' }css style for drag wrapper
onDragStart?(_: DOMRect) => void-Called whenever the user mouses down
onDragEnd?(_: DOMRect) => void-Called when dragging stops

License

MIT

Keywords

drag

FAQs

Package last updated on 17 Sep 2022

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