https://github.com/nanxiaobei/react-spring-dnd
🕊 A deadly simple drag and drop solution using react-spring
https://github.com/nanxiaobei/react-spring-dnd
Last synced: 6 months ago
JSON representation
🕊 A deadly simple drag and drop solution using react-spring
- Host: GitHub
- URL: https://github.com/nanxiaobei/react-spring-dnd
- Owner: nanxiaobei
- License: mit
- Created: 2020-07-18T17:16:43.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-20T08:47:10.000Z (almost 2 years ago)
- Last Synced: 2024-04-27T09:34:30.857Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 355 KB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
# react-spring-dnd 🕊
A deadly simple drag and drop solution using react-spring
[](https://www.npmjs.com/package/react-spring-dnd)
[](https://www.npmtrends.com/react-spring-dnd)
[](https://bundlephobia.com/result?p=react-spring-dnd)
[](https://github.com/facebook/react)
[](https://github.com/nanxiaobei/react-spring-dnd/blob/main/LICENSE)
---
## Play
[](https://codesandbox.io/s/react-spring-dnd-lnz70?fontsize=14&hidenavigation=1&theme=dark&file=/src/App.jsx)
## Install
```shell
pnpm add react-spring-dnd
# or
yarn add react-spring-dnd
# or
npm i react-spring-dnd
```
## Usage
```jsx
import SpringList from 'react-spring-dnd';
const App = () => {
return (
{'hello react spring dnd 👋⚛️🌀🦥'.split(' ').map((item) => (
{item}
))}
);
};
```
## API
| Prop | Type | Default | Description |
| ----------- | ---------- | ------- | ------------------------------------------- |
| `row` | `boolean` | `false` | Display as row |
| `onDragEnd` | `function` | - | `onDragEnd` callback, `(orderList) => void` |
| `children` | `array` | `[]` | Draggable items |
## License
[MIT License](https://github.com/nanxiaobei/react-spring-dnd/blob/main/LICENSE) © [nanxiaobei](https://lee.so/)
