Socket
Socket
Sign inDemoInstall

react-sortable-item

Package Overview
Dependencies
36
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-sortable-item

Reorder elements in a list. Uses the native HTML5 Drag and Drop API.


Version published
Maintainers
1
Install size
8.09 MB
Created

Readme

Source

react-sortable-item

Reorder elements in a list. Uses the native HTML5 Drag and Drop API.

This library is quite different from others in that treats the reindexing strategy as an implementation detail.

var ExampleSortableList = React.createClass({
  handleDrop: function(dropPath, position, event) {},

  handleAcceptTest: function(event) {},

  render: function() {
    var list = yourRecords.map(function(record) {
      return (
        <SortableItem
            key={record.id}
            type={record.type}
            data={record.path}
            handleDrop={this.handleDrop}
            handleAcceptTest={this.handleAcceptTest}>
          <li>
            <div className="li-inner">
              {record.label}
            </div>
          </li>
        </SortableItem>
      );
    }.bind(this))
    return (
      <ul>
        {list}
      </ul>
    )
  }
})

License

MIT

FAQs

Last updated on 10 Mar 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc