react-spring-dnd

A deadly simple drag and drop solution using react-spring

Usage no npm install needed!

<script type="module">
  import reactSpringDnd from 'https://cdn.skypack.dev/react-spring-dnd';
</script>

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