teabyii / react-easy-sortable

Sortable List Component with React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-easy-sortable

Sortable list component with react that should be easy to use ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

npm version

Installation

Using npm:

npm install react-easy-sortable --save

Usage

import { SortableList, SortableItem } from 'react-easy-sortable'

export default class SortableComponent {
  onSort (target, indexList) {
    // ...
  }

  render () {
    return (
      <SortableList onSort={this.onSort.bind(this)}>
        <SortableItem>
          Your Components
        </SortableItem>
        { /* ... */ }
      </SortableList>
    )
  }
}

Using Webpack or other module bunlder to pack it.

About

Sortable List Component with React

License:MIT License


Languages

Language:JavaScript 97.7%Language:CSS 2.3%