1.1.0 • Published 4 years ago

react-draggable-array v1.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

NPM

Wrapper component utilizing native browser drag API for its children. Happy dragging.

Install

Available as an npm package

npm install --save react-draggable-array

Usage

import React from 'react'

// Import the component
import DraggableArray from 'react-draggable-array'
// Import the css
import 'react-draggable-array/dist/index.css'

const App = () => {

  // Define the array
  const items = [ '🦜', '🦖', '🦆', '🦔', '🐤', '🐧' ]

  return (
    // Wrap a map of the items in the DraggableArray component
    <DraggableArray>
      {items.map((item) => (
        <p>{item}</p>
      ))}
    </DraggableArray>
  )
}

Edit Button

Options

propaction
classNameapply a className to the Wrapper Component
row ( default )displays children in row orientation
coldisplays children in col orientation

License

This project is licensed under the terms of the MIT license

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago