0.0.6 • Published 7 years ago

react-sortable-dnd v0.0.6

Weekly downloads
4
License
ISC
Repository
-
Last release
7 years ago

react-sortable-dnd

A React component to sort elements of any type. It also supports dropping external elements in any position.

Demo

Install

npm i react-sortable-dnd --save 

Usage

<Sortable onSort={components => console.log(components)}>
    <div>Apple</div>
    <div>Mango</div>
    <div>Pineapple</div>
</Sortable>

Props

PropType/OptionsDefaultDescription
classNamestringSortableOptional The class name of the component
classPlaceholderstringPlaceholderOptional The class name of the placeholder component when dragging external elements.
enabledbooleantrueOptional Enable/disable the sorting
typestring | Optional Type of the elements to sort, in case you want to restrict elements of other Sortable lists.

Event Props

PropParametersDescription
onSort(components)The sorting callback function.
onSortStart(components)Triggered when an element starts being dragged.
onDrop(e, data, index)Optional Called when an external element is dropped.

Changelog

  • 1.0.0
    • Initial release :tada:

License

ISC License

0.0.6

7 years ago

0.0.5

7 years ago