react-dragula

WebJar for react-dragula

License

License

MIT
Categories

Categories

Github Development Tools Version Controls React User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-bevacqua-react-dragula
Last Version

Last Version

1.1.17
Release Date

Release Date

Type

Type

jar
Description

Description

react-dragula
WebJar for react-dragula
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/bevacqua/react-dragula

Download github-com-bevacqua-react-dragula

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-bevacqua-react-dragula/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-bevacqua-react-dragula</artifactId>
    <version>1.1.17</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-bevacqua-react-dragula/
implementation 'org.webjars.npm:github-com-bevacqua-react-dragula:1.1.17'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-bevacqua-react-dragula/
implementation ("org.webjars.npm:github-com-bevacqua-react-dragula:1.1.17")
'org.webjars.npm:github-com-bevacqua-react-dragula:jar:1.1.17'
<dependency org="org.webjars.npm" name="github-com-bevacqua-react-dragula" rev="1.1.17">
  <artifact name="github-com-bevacqua-react-dragula" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-bevacqua-react-dragula', version='1.1.17')
)
libraryDependencies += "org.webjars.npm" % "github-com-bevacqua-react-dragula" % "1.1.17"
[org.webjars.npm/github-com-bevacqua-react-dragula "1.1.17"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : atoa jar [1.0.0]
org.webjars.npm : dragula jar [3.7.2]

Project Modules

There are no modules declared in this project.

logo.png

Drag and drop so simple it hurts

Official React wrapper for dragula.

Demo

demo.png

Try out the demo!

Install

You can get it on npm.

npm install react-dragula --save

Or bower, too.

bower install react-dragula --save

Usage

Refer to the documentation for dragula. The API for react-dragula is identical, but a few tiny tweaks were made around it so that it works out the box with React.

Example

Here's an example application using react and react-dragula.

var React = require('react');
var dragula = require('react-dragula');
var App = React.createClass({
  render: function () {
    return <div className='container'>
      <div>Swap me around</div>
      <div>Swap her around</div>
      <div>Swap him around</div>
      <div>Swap them around</div>
      <div>Swap us around</div>
      <div>Swap things around</div>
      <div>Swap everything around</div>
    </div>;
  },
  componentDidMount: function () {
    var container = React.findDOMNode(this);
    dragula([container]);
  }
});
React.render(<App />, document.getElementById('examples'));

Example using refs (ES2015 syntax)

Here's an example using refs (ES2015 syntax): React: The ref Callback Attribute

import * as React from "react";
import * as ReactDOM from 'react-dom';
import Dragula from 'react-dragula';
export class App extends React.Component {
  render () {
    return <div className='container' ref={this.dragulaDecorator}>
      <div>Swap me around</div>
      <div>Swap her around</div>
      <div>Swap him around</div>
      <div>Swap them around</div>
      <div>Swap us around</div>
      <div>Swap things around</div>
      <div>Swap everything around</div>
    </div>;
  },
  dragulaDecorator = (componentBackingInstance) => {
    if (componentBackingInstance) {
      let options = { };
      Dragula([componentBackingInstance], options);
    }
  };
});
ReactDOM.render(<App />, document.getElementById('examples'));

License

MIT

Versions

Version
1.1.17