react-spring-dnd

A deadly simple drag and drop solution using react-spring

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-spring-dnd
610.2.0a year ago2 years agoMinified + gzip package size for react-spring-dnd in KB

Readme

react-spring-dnd 🕊
A deadly simple drag and drop solution using react-spring
npm npm npm bundle size npm peer dependency version GitHub

Play with this example!

Add

yarn add react-spring-dnd

# or

npm i react-spring-dnd

Use

import SpringList from 'react-spring-dnd';

const App = () => (
  <SpringList>
    {'hello react spring dnd 👋⚛️🌀🦥'.split(' ').map((item) => (
      <div key={item}>{item}</div>
    ))}
  </SpringList>
);

Try

Live demo →

API

| Prop | Type | Default | Description | | ----------- | ---------- | ------- | --------------------------------------- | | row | boolean | false | If show as row | | onDragEnd | function | - | onDragEnd callback, (order) => void | | children | array | [] | Draggable items |

License

MIT License © nanxiaobei