react-draggable-array
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Draggable Array

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

prop action
className apply a className to the Wrapper Component
row ( default ) displays children in row orientation
col displays children in col orientation

License

This project is licensed under the terms of the MIT license

Dependents (0)

Package Sidebar

Install

npm i react-draggable-array

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

27.7 kB

Total Files

9

Last publish

Collaborators

  • capriok7