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

react-dragon

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dragon

A dead simple react drag and drop component

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Dragon NPM

A very simple drag and drop component. Did I mention it was simple?

Usage

PropertiesDescription
onDropRequired. This is the callback that executes when an item is dropped onto a <Dragon />
allowDirectly translates to event.dataTransfer.effectAllowed. Defaults to "all"
classNameAdditional css class names. This can be a string or an object. The value will be injected into the classSet React addon
effectDirectly translates to event.dataTransfer.dropEffect. Defaults to "copy"
elementWhat element to use as the wrapper for the dragon. Defaults to "div"
messageThis is the token that will be passed when a <Dragon /> is dropped onto another <Dragon /> it must be JSON serialization compatible.
React.createClass({

  render() {
    return (
      <Dragon message={ 'something' } onDrop={ this._onDrop } element="p">
        { this.props.children }
      </Dragon>
    )
  },

  _onDrop(transmission, receiver) {
    // the transmission is the message from the dragged element
    // the receiver is the message from the dropped element
  }
})

Keywords

FAQs

Package last updated on 31 Jan 2015

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