react-native-reanimated-dnd 1.0.5 โ 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +373 -386
- package/lib/components/Draggable.js +1 -1
- package/lib/components/Droppable.d.ts +0 -1
- package/lib/components/Droppable.js +1 -1
- package/lib/components/Sortable.d.ts +1 -3
- package/lib/components/Sortable.js +1 -1
- package/lib/components/SortableGrid.d.ts +3 -0
- package/lib/components/SortableGrid.js +1 -0
- package/lib/components/SortableGridItem.d.ts +7 -0
- package/lib/components/SortableGridItem.js +1 -0
- package/lib/components/SortableItem.d.ts +2 -2
- package/lib/components/SortableItem.js +1 -1
- package/lib/components/sortableUtils.d.ts +33 -0
- package/lib/components/sortableUtils.js +1 -1
- package/lib/context/DropContext.js +1 -1
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/safeMeasure.d.ts +3 -0
- package/lib/hooks/safeMeasure.js +1 -0
- package/lib/hooks/useDraggable.js +1 -1
- package/lib/hooks/useDroppable.js +1 -1
- package/lib/hooks/useGridSortable.d.ts +2 -0
- package/lib/hooks/useGridSortable.js +1 -0
- package/lib/hooks/useGridSortableList.d.ts +3 -0
- package/lib/hooks/useGridSortableList.js +1 -0
- package/lib/hooks/useHorizontalSortable.d.ts +2 -0
- package/lib/hooks/useHorizontalSortable.js +1 -0
- package/lib/hooks/useHorizontalSortableList.d.ts +4 -0
- package/lib/hooks/useHorizontalSortableList.js +1 -0
- package/lib/hooks/useSortable.d.ts +13 -6
- package/lib/hooks/useSortable.js +1 -1
- package/lib/hooks/useSortableList.d.ts +15 -3
- package/lib/hooks/useSortableList.js +1 -1
- package/lib/index.d.ts +7 -0
- package/lib/index.js +1 -1
- package/lib/types/draggable.d.ts +3 -0
- package/lib/types/grid.d.ts +148 -0
- package/lib/types/grid.js +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -1
- package/lib/types/sortable.d.ts +197 -19
- package/lib/types/sortable.js +1 -1
- package/lib/utils/gridCalculations.d.ts +21 -0
- package/lib/utils/gridCalculations.js +1 -0
- package/package.json +23 -15
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# React Native Reanimated DnD ๐ฏ
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
https://github.com/user-attachments/assets/023c0a9c-194a-45a9-bb88-ac8f16f5ffd5
|
|
6
|
+
|
|
5
7
|
</p>
|
|
6
8
|
<div align="center">
|
|
7
9
|
|
|
@@ -12,15 +14,18 @@ _Powerful, performant, and built for the modern React Native developer_
|
|
|
12
14
|
[](https://badge.fury.io/js/react-native-reanimated-dnd)
|
|
13
15
|
[](https://opensource.org/licenses/MIT)
|
|
14
16
|
[](https://www.typescriptlang.org/)
|
|
15
|
-
[](https://reactnative.dev/)
|
|
16
18
|
|
|
17
19
|
<br />
|
|
18
20
|
|
|
19
|
-
<a href="https://react-native-reanimated-dnd
|
|
20
|
-
<img src="https://img.shields.io/badge
|
|
21
|
+
<a href="https://www.npmjs.com/package/react-native-reanimated-dnd" target="_blank">
|
|
22
|
+
<img src="https://img.shields.io/badge/๐ฆ%20View%20on%20NPM-cb3837?style=for-the-badge&logo=npm&logoColor=white&labelColor=1e293b&fontSize=24" alt="NPM Package" height="36"/>
|
|
23
|
+
</a>
|
|
24
|
+
<a href="https://reanimated-dnd-docs.vercel.app/" target="_blank">
|
|
25
|
+
<img src="https://img.shields.io/badge/๐%20Read%20the%20Docs-4f46e5?style=for-the-badge&logo=gitbook&logoColor=white&labelColor=1e293b&color=6366f1&fontSize=24" alt="Documentation" height="36"/>
|
|
21
26
|
</a>
|
|
22
27
|
<a href="#-interactive-examples" target="_blank">
|
|
23
|
-
<img src="https://img.shields.io/badge/๐ฑ%20Try%20Live%20Demo-
|
|
28
|
+
<img src="https://img.shields.io/badge/๐ฑ%20Try%20Live%20Demo-fcba03?style=for-the-badge&logo=expo&logoColor=white&labelColor=1e293b&fontSize=24" alt="Live Demo" height="36"/>
|
|
24
29
|
</a>
|
|
25
30
|
|
|
26
31
|
</div>
|
|
@@ -35,15 +40,20 @@ After countless attempts with drag-and-drop solutions that don't work or are sim
|
|
|
35
40
|
|
|
36
41
|
## โจ Features
|
|
37
42
|
|
|
38
|
-
- ๐ **High Performance** - Built with Reanimated
|
|
43
|
+
- ๐ **High Performance** - Built with Reanimated 4 and Worklets for buttery-smooth 60fps animations
|
|
44
|
+
- ๐๏ธ **New Architecture Ready** - Built for the modern React Native architecture used by Expo SDK 55+
|
|
45
|
+
- ๐ฆ **Expo Compatible** - Tested against Expo SDK 55 and React Native 0.83
|
|
46
|
+
- ๐ชถ **Tiny Bundle Size** - Only 70kb unpacked size, won't bloat your app
|
|
39
47
|
- ๐ฏ **Flexible API** - From simple drag-and-drop to complex sortable lists
|
|
40
48
|
- ๐ฑ **React Native First** - Designed specifically for mobile, not ported from web
|
|
41
49
|
- ๐ง **TypeScript Ready** - Full type safety with comprehensive definitions
|
|
42
50
|
- ๐จ **Infinitely Customizable** - Every animation, behavior, and style is configurable
|
|
43
51
|
- ๐ฆ **Complete Component Suite** - Draggable, Droppable, Sortable, and more
|
|
44
52
|
- ๐ช **Smart Collision Detection** - Multiple algorithms (center, intersect, contain)
|
|
45
|
-
- ๐ **Sortable Lists** - Drag and drop to sort
|
|
46
|
-
|
|
53
|
+
- ๐ **Vertical & Horizontal Sortable Lists** - Drag and drop to sort lists in any direction with automatic scrolling
|
|
54
|
+
- ๐ฒ **Sortable Grids** - 2D grid drag-and-drop with flexible layouts, insert and swap modes
|
|
55
|
+
- โ **Dynamic Heights** - Sortable lists with variable item heights
|
|
56
|
+
- โก **FlatList Performance** - Optional FlatList rendering for large datasets with virtualization
|
|
47
57
|
- ๐ญ **Drag Handles** - Precise control with dedicated drag areas
|
|
48
58
|
- ๐ฌ **Custom Animations** - Spring, timing, or bring your own animation functions
|
|
49
59
|
- ๐ **Pixel-Perfect Positioning** - 9-point alignment system with custom offsets
|
|
@@ -53,7 +63,7 @@ After countless attempts with drag-and-drop solutions that don't work or are sim
|
|
|
53
63
|
|
|
54
64
|
## ๐ฑ Interactive Examples
|
|
55
65
|
|
|
56
|
-
**See it in action!** A comprehensive example app with **
|
|
66
|
+
**See it in action!** A comprehensive example app with **18 interactive demos** showcasing every feature and use case.
|
|
57
67
|
|
|
58
68
|
<div align="center">
|
|
59
69
|
|
|
@@ -65,19 +75,18 @@ After countless attempts with drag-and-drop solutions that don't work or are sim
|
|
|
65
75
|
|
|
66
76
|
**๐ฑ Scan & Play**
|
|
67
77
|
|
|
68
|
-
<img src="https://
|
|
78
|
+
<img src="https://raw.githubusercontent.com/entropyconquers/react-native-reanimated-dnd/main/documentation/images/expo-qr-code.png" alt="Expo QR Code" width="200" height="200" />
|
|
69
79
|
|
|
70
|
-
|
|
80
|
+
_Scan with Expo Go to try the demo instantly_
|
|
71
81
|
|
|
72
82
|
</td>
|
|
73
83
|
<td align="center" width="50%">
|
|
74
84
|
|
|
75
85
|
**๐ Quick Start**
|
|
76
86
|
|
|
77
|
-
1. Install [Expo Go](https://expo.dev/
|
|
87
|
+
1. Install [Expo Go](https://expo.dev/go) on your phone (SDK 55)
|
|
78
88
|
2. Scan the QR code with your camera
|
|
79
|
-
3.
|
|
80
|
-
4. Explore 15 interactive examples!
|
|
89
|
+
3. Explore 18 interactive examples!
|
|
81
90
|
|
|
82
91
|
**Or browse the code:**
|
|
83
92
|
[**๐ View Example App โ**](./example-app/README.md)
|
|
@@ -88,93 +97,173 @@ After countless attempts with drag-and-drop solutions that don't work or are sim
|
|
|
88
97
|
|
|
89
98
|
### ๐ Complete Documentation
|
|
90
99
|
|
|
91
|
-
<a href="https://
|
|
100
|
+
<a href="https://reanimated-dnd-docs.vercel.app/" target="_blank">
|
|
92
101
|
<img src="https://img.shields.io/badge/๐%20Documentation-Visit%20Docs-4f46e5?style=for-the-badge&logo=gitbook&logoColor=white&labelColor=1e293b" alt="Documentation" />
|
|
93
102
|
</a>
|
|
94
103
|
|
|
95
|
-
|
|
104
|
+
_Comprehensive guides, API reference, and interactive examples_
|
|
96
105
|
|
|
97
106
|
</div>
|
|
98
107
|
|
|
99
108
|
The example app includes:
|
|
100
109
|
|
|
101
|
-
- ๐ต **Sortable Music Queue** - Complete list reordering with handles
|
|
102
|
-
-
|
|
103
|
-
-
|
|
110
|
+
- ๐ต **Sortable Music Queue** - Complete list reordering with drag handles
|
|
111
|
+
- โ **Horizontal Sortable** - Reorderable horizontal scrolling list
|
|
112
|
+
- ๐ฒ **Sortable Grid** - 2D grid reordering with insert/swap modes
|
|
113
|
+
- โ **Dynamic Heights** - Sortable list with variable item heights
|
|
114
|
+
- ๐ฏ **Basic Drag & Drop** - Drag items to drop zones with pre-drag delay
|
|
115
|
+
- ๐ช **Drag Handles** - Dedicated drag regions for precise control
|
|
116
|
+
- ๐ฌ **Custom Animations** - Spring, timing, bounce & easing curves
|
|
117
|
+
- โจ **Active Drop Styles** - Visual feedback on hover
|
|
118
|
+
- ๐ **Alignment & Offset** - Precise drop positioning with offsets
|
|
104
119
|
- ๐ฆ **Boundary Constraints** - Axis-locked and bounded dragging
|
|
105
|
-
-
|
|
106
|
-
-
|
|
120
|
+
- ๐ฏ **Collision Detection** - Center, intersect & contain algorithms
|
|
121
|
+
- ๐บ๏ธ **Dropped Items Map** - Track items across multiple zones
|
|
122
|
+
- โก **Drag State** - State enum & onStateChange lifecycle
|
|
123
|
+
- โ๏ธ **Custom Draggable** - useDraggable hook implementation
|
|
107
124
|
|
|
108
|
-
## ๐ฌ
|
|
109
|
-
|
|
110
|
-
**See the library in action** with these demos showcasing some of the key features and use cases.
|
|
125
|
+
## ๐ฌ Demo Showcase
|
|
111
126
|
|
|
112
127
|
<div align="center">
|
|
113
128
|
|
|
114
129
|
<table>
|
|
115
130
|
<tr>
|
|
116
|
-
<td align="center" width="
|
|
131
|
+
<td align="center" width="33%">
|
|
132
|
+
|
|
133
|
+
### ๐ต Sortable Music Queue
|
|
117
134
|
|
|
118
|
-
|
|
119
|
-
*Drag and drop to reorder items with smooth animations*
|
|
135
|
+
_Vertical list reordering with drag handles_
|
|
120
136
|
|
|
121
|
-
https://github.com/user-attachments/assets/
|
|
137
|
+
https://github.com/user-attachments/assets/6493c05f-571c-416d-b81d-90bee98738b4
|
|
122
138
|
|
|
123
139
|
**Features:** Auto-scrolling โข Drag handles โข Smooth transitions
|
|
124
140
|
|
|
125
141
|
</td>
|
|
126
|
-
<td align="center" width="
|
|
142
|
+
<td align="center" width="33%">
|
|
127
143
|
|
|
128
|
-
###
|
|
129
|
-
*Multiple algorithms for precise drop targeting*
|
|
144
|
+
### โ Horizontal Sortable
|
|
130
145
|
|
|
131
|
-
|
|
146
|
+
_Reorderable horizontal scrolling list_
|
|
132
147
|
|
|
133
|
-
|
|
148
|
+
https://github.com/user-attachments/assets/909c687e-146d-4233-a6e9-4bc3e7b69a35
|
|
149
|
+
|
|
150
|
+
**Features:** Horizontal scroll โข Handle & full item modes
|
|
151
|
+
|
|
152
|
+
</td>
|
|
153
|
+
<td align="center" width="33%">
|
|
154
|
+
|
|
155
|
+
### ๐ฒ Grid Sortable
|
|
156
|
+
|
|
157
|
+
_2D grid reordering with insert & swap_
|
|
158
|
+
|
|
159
|
+
https://github.com/user-attachments/assets/9647af01-098c-485f-92ba-cfc39d1bba0c
|
|
160
|
+
|
|
161
|
+
**Features:** Grid layout โข Insert & swap modes
|
|
134
162
|
|
|
135
163
|
</td>
|
|
136
164
|
</tr>
|
|
137
165
|
<tr>
|
|
138
|
-
<td align="center" width="
|
|
166
|
+
<td align="center" width="33%">
|
|
139
167
|
|
|
140
|
-
###
|
|
141
|
-
*Precise control with dedicated drag areas*
|
|
168
|
+
### โ Dynamic Heights
|
|
142
169
|
|
|
143
|
-
|
|
170
|
+
_Sortable list with variable item heights_
|
|
144
171
|
|
|
145
|
-
|
|
172
|
+
https://github.com/user-attachments/assets/b53078ca-51ab-4675-9389-e8fe69492370
|
|
173
|
+
|
|
174
|
+
**Features:** Variable heights โข Expand/collapse โข Auto-scroll
|
|
146
175
|
|
|
147
176
|
</td>
|
|
148
|
-
<td align="center" width="
|
|
177
|
+
<td align="center" width="33%">
|
|
149
178
|
|
|
150
|
-
###
|
|
151
|
-
|
|
179
|
+
### ๐ฏ Basic Drag & Drop
|
|
180
|
+
|
|
181
|
+
_Drag items to drop zones_
|
|
182
|
+
|
|
183
|
+
https://github.com/user-attachments/assets/05859d25-6749-41b7-ae7e-cad5f864a268
|
|
152
184
|
|
|
153
|
-
|
|
185
|
+
**Features:** Drop zones โข Pre-drag delay โข Visual feedback
|
|
154
186
|
|
|
155
|
-
|
|
187
|
+
</td>
|
|
188
|
+
<td align="center" width="33%">
|
|
189
|
+
|
|
190
|
+
### ๐ญ Drag Handles
|
|
191
|
+
|
|
192
|
+
_Dedicated regions for drag control_
|
|
193
|
+
|
|
194
|
+
https://github.com/user-attachments/assets/f8be7bea-0f24-4446-83be-06ede43fa02a
|
|
195
|
+
|
|
196
|
+
**Features:** Full handle โข Bar handle โข Header handle
|
|
156
197
|
|
|
157
198
|
</td>
|
|
158
199
|
</tr>
|
|
159
200
|
<tr>
|
|
160
|
-
<td align="center" width="
|
|
201
|
+
<td align="center" width="33%">
|
|
161
202
|
|
|
162
203
|
### โจ Active Drop Styles
|
|
163
|
-
*Visual feedback during drag operations*
|
|
164
204
|
|
|
165
|
-
|
|
205
|
+
_Visual hover effects on drop zones_
|
|
166
206
|
|
|
167
|
-
|
|
207
|
+
https://github.com/user-attachments/assets/d4124110-6eb7-4a15-8f97-3e58b392d62e
|
|
208
|
+
|
|
209
|
+
**Feedback:** Pulse effect โข Glow effect โข Hover states
|
|
168
210
|
|
|
169
211
|
</td>
|
|
170
|
-
<td align="center" width="
|
|
212
|
+
<td align="center" width="33%">
|
|
213
|
+
|
|
214
|
+
### ๐ Alignment & Offset
|
|
171
215
|
|
|
172
|
-
|
|
173
|
-
*Complete lifecycle tracking and callbacks*
|
|
216
|
+
_Precise drop positioning with offsets_
|
|
174
217
|
|
|
175
|
-
https://github.com/user-attachments/assets/
|
|
218
|
+
https://github.com/user-attachments/assets/07fd39d0-a0d8-471c-86be-b73d70027163
|
|
176
219
|
|
|
177
|
-
**
|
|
220
|
+
**Features:** 9-point alignment โข X/Y offset controls
|
|
221
|
+
|
|
222
|
+
</td>
|
|
223
|
+
<td align="center" width="33%">
|
|
224
|
+
|
|
225
|
+
### ๐ฆ Bounded Dragging
|
|
226
|
+
|
|
227
|
+
_Constrain movement within boundaries_
|
|
228
|
+
|
|
229
|
+
https://github.com/user-attachments/assets/ce43a226-ec42-49c1-b528-df6599d294e1
|
|
230
|
+
|
|
231
|
+
**Constraints:** Container bounds โข Axis-locked โข Custom limits
|
|
232
|
+
|
|
233
|
+
</td>
|
|
234
|
+
</tr>
|
|
235
|
+
<tr>
|
|
236
|
+
<td align="center" width="33%">
|
|
237
|
+
|
|
238
|
+
### ๐ช Collision Detection
|
|
239
|
+
|
|
240
|
+
_Center, intersect & contain algorithms_
|
|
241
|
+
|
|
242
|
+
https://github.com/user-attachments/assets/1ac1860a-acc1-469a-ae3e-644a22393b86
|
|
243
|
+
|
|
244
|
+
**Algorithms:** Center โข Intersect โข Contain
|
|
245
|
+
|
|
246
|
+
</td>
|
|
247
|
+
<td align="center" width="33%">
|
|
248
|
+
|
|
249
|
+
### ๐บ๏ธ Dropped Items Map
|
|
250
|
+
|
|
251
|
+
_Track items across multiple zones_
|
|
252
|
+
|
|
253
|
+
https://github.com/user-attachments/assets/e4effc88-7161-4c5c-af6e-c06152cfbd09
|
|
254
|
+
|
|
255
|
+
**Features:** Multi-zone tracking โข Real-time mapping
|
|
256
|
+
|
|
257
|
+
</td>
|
|
258
|
+
<td align="center" width="33%">
|
|
259
|
+
|
|
260
|
+
### โก Drag State
|
|
261
|
+
|
|
262
|
+
_State lifecycle tracking & callbacks_
|
|
263
|
+
|
|
264
|
+
https://github.com/user-attachments/assets/bceb9e7c-8f29-4630-81b0-945a7bcf29c5
|
|
265
|
+
|
|
266
|
+
**States:** Idle โข Dragging โข Dropped
|
|
178
267
|
|
|
179
268
|
</td>
|
|
180
269
|
</tr>
|
|
@@ -191,88 +280,98 @@ npm install react-native-reanimated-dnd
|
|
|
191
280
|
### Peer Dependencies
|
|
192
281
|
|
|
193
282
|
```bash
|
|
194
|
-
npm install react-native-reanimated react-native-gesture-handler
|
|
283
|
+
npm install react-native-reanimated react-native-gesture-handler react-native-worklets
|
|
195
284
|
```
|
|
196
285
|
|
|
197
286
|
Follow the setup guides:
|
|
198
287
|
|
|
199
|
-
- [React Native
|
|
288
|
+
- [React Native Worklets](https://docs.swmansion.com/react-native-worklets/docs/getting-started/installation/)
|
|
289
|
+
- [React Native Reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/)
|
|
200
290
|
- [React Native Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/docs/installation)
|
|
201
291
|
|
|
202
|
-
|
|
292
|
+
Make sure your Babel config uses `"react-native-worklets/plugin"` as the last plugin and that your app is running on the New Architecture, which is required by Reanimated 4.
|
|
203
293
|
|
|
204
|
-
|
|
294
|
+
## ๐ Requirements
|
|
205
295
|
|
|
206
|
-
|
|
207
|
-
import React from "react";
|
|
208
|
-
import { View, Text } from "react-native";
|
|
209
|
-
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
210
|
-
import { Draggable, DropProvider } from "react-native-reanimated-dnd";
|
|
296
|
+
### Data Structure
|
|
211
297
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
<View
|
|
219
|
-
style={{
|
|
220
|
-
padding: 20,
|
|
221
|
-
backgroundColor: "#007AFF",
|
|
222
|
-
borderRadius: 8,
|
|
223
|
-
}}
|
|
224
|
-
>
|
|
225
|
-
<Text style={{ color: "white" }}>Drag me around!</Text>
|
|
226
|
-
</View>
|
|
227
|
-
</Draggable>
|
|
228
|
-
</View>
|
|
229
|
-
</DropProvider>
|
|
230
|
-
</GestureHandlerRootView>
|
|
231
|
-
);
|
|
298
|
+
All items in your data array **MUST** have an `id` property of type string:
|
|
299
|
+
|
|
300
|
+
```typescript
|
|
301
|
+
interface YourDataType {
|
|
302
|
+
id: string; // Required!
|
|
303
|
+
// ... your other properties
|
|
232
304
|
}
|
|
233
305
|
```
|
|
234
306
|
|
|
235
|
-
|
|
307
|
+
This is essential for the library to track items during reordering.
|
|
308
|
+
|
|
309
|
+
**Example:**
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
// โ
Good - Each item has a unique string id
|
|
313
|
+
const tasks = [
|
|
314
|
+
{ id: "1", title: "Learn React Native", completed: false },
|
|
315
|
+
{ id: "2", title: "Build an app", completed: false },
|
|
316
|
+
{ id: "3", title: "Deploy to store", completed: true },
|
|
317
|
+
];
|
|
318
|
+
|
|
319
|
+
// โ Bad - Missing id properties
|
|
320
|
+
const badTasks = [{ title: "Task 1" }, { title: "Task 2" }];
|
|
321
|
+
|
|
322
|
+
// โ Bad - Non-string ids
|
|
323
|
+
const badTasksWithNumbers = [
|
|
324
|
+
{ id: 1, title: "Task 1" },
|
|
325
|
+
{ id: 2, title: "Task 2" },
|
|
326
|
+
];
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
The library includes runtime validation in development mode that will warn you if items are missing valid ID properties.
|
|
330
|
+
|
|
331
|
+
## State Management Guidelines
|
|
332
|
+
|
|
333
|
+
**IMPORTANT**: Sortable components maintain their own internal state for optimal performance and animation consistency.
|
|
334
|
+
|
|
335
|
+
### Do NOT Do This
|
|
336
|
+
|
|
337
|
+
- Never update external state (arrays, Redux, Zustand, etc.) directly in `onMove` callbacks
|
|
338
|
+
- Never call `setItems()`, `setTasks()`, or similar functions during drag operations
|
|
339
|
+
- Never manually splice or reorder external arrays in response to drag events
|
|
340
|
+
|
|
341
|
+
### Correct Approach
|
|
342
|
+
|
|
343
|
+
- Use `onMove` for logging, analytics, or side effects only
|
|
344
|
+
- Use `onDrop` with `allPositions` parameter for read-only position tracking
|
|
345
|
+
- Let sortable components handle their internal reordering automatically
|
|
346
|
+
- Use external state only for the initial data and for non-reordering updates
|
|
347
|
+
|
|
348
|
+
### Future Features
|
|
349
|
+
|
|
350
|
+
Programmatic list operations (add, update, delete, reorder items) that work correctly with internal state management will be added in upcoming releases. This will provide safe methods to modify sortable lists externally.
|
|
351
|
+
|
|
352
|
+
## ๐โโ๏ธ Quick Start
|
|
353
|
+
|
|
354
|
+
### Basic Drag & Drop
|
|
236
355
|
|
|
237
356
|
```tsx
|
|
238
|
-
import React from "react";
|
|
239
|
-
import { View, Text } from "react-native";
|
|
240
357
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
241
|
-
import {
|
|
242
|
-
Draggable,
|
|
243
|
-
Droppable,
|
|
244
|
-
DropProvider,
|
|
245
|
-
} from "react-native-reanimated-dnd";
|
|
246
|
-
|
|
247
|
-
export default function DragDropExample() {
|
|
248
|
-
const handleDrop = (data: any) => {
|
|
249
|
-
console.log("Item dropped:", data);
|
|
250
|
-
};
|
|
358
|
+
import { Draggable, Droppable, DropProvider } from "react-native-reanimated-dnd";
|
|
251
359
|
|
|
360
|
+
export default function App() {
|
|
252
361
|
return (
|
|
253
362
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
254
363
|
<DropProvider>
|
|
255
|
-
<
|
|
256
|
-
{
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
<Text>๐ฏ Drop Zone 1</Text>
|
|
267
|
-
</View>
|
|
268
|
-
</Droppable>
|
|
269
|
-
|
|
270
|
-
<Droppable onDrop={handleDrop}>
|
|
271
|
-
<View style={styles.dropZone}>
|
|
272
|
-
<Text>๐ฏ Drop Zone 2</Text>
|
|
273
|
-
</View>
|
|
274
|
-
</Droppable>
|
|
275
|
-
</View>
|
|
364
|
+
<Droppable onDrop={(data) => console.log("Dropped:", data)}>
|
|
365
|
+
<View style={styles.dropZone}>
|
|
366
|
+
<Text>Drop here</Text>
|
|
367
|
+
</View>
|
|
368
|
+
</Droppable>
|
|
369
|
+
|
|
370
|
+
<Draggable data={{ id: "1", title: "Drag me!" }}>
|
|
371
|
+
<View style={styles.item}>
|
|
372
|
+
<Text>Drag me around!</Text>
|
|
373
|
+
</View>
|
|
374
|
+
</Draggable>
|
|
276
375
|
</DropProvider>
|
|
277
376
|
</GestureHandlerRootView>
|
|
278
377
|
);
|
|
@@ -282,333 +381,203 @@ export default function DragDropExample() {
|
|
|
282
381
|
### Sortable List
|
|
283
382
|
|
|
284
383
|
```tsx
|
|
285
|
-
import
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
384
|
+
import { Sortable, SortableItem, SortableRenderItemProps } from "react-native-reanimated-dnd";
|
|
385
|
+
|
|
386
|
+
const tasks = [
|
|
387
|
+
{ id: "1", title: "Learn React Native" },
|
|
388
|
+
{ id: "2", title: "Build an app" },
|
|
389
|
+
{ id: "3", title: "Deploy to store" },
|
|
390
|
+
];
|
|
391
|
+
|
|
392
|
+
function TaskList() {
|
|
393
|
+
const renderItem = useCallback((props: SortableRenderItemProps<typeof tasks[0]>) => {
|
|
394
|
+
const { item, id, ...rest } = props;
|
|
395
|
+
return (
|
|
396
|
+
<SortableItem key={id} id={id} data={item} {...rest}>
|
|
397
|
+
<View style={styles.task}>
|
|
398
|
+
<Text>{item.title}</Text>
|
|
399
|
+
<SortableItem.Handle>
|
|
400
|
+
<Text>โฎโฎ</Text>
|
|
401
|
+
</SortableItem.Handle>
|
|
402
|
+
</View>
|
|
403
|
+
</SortableItem>
|
|
404
|
+
);
|
|
405
|
+
}, []);
|
|
289
406
|
|
|
290
|
-
|
|
291
|
-
id: string;
|
|
292
|
-
title: string;
|
|
407
|
+
return <Sortable data={tasks} renderItem={renderItem} itemHeight={60} />;
|
|
293
408
|
}
|
|
409
|
+
```
|
|
294
410
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
{/* Drag Handle */}
|
|
319
|
-
<SortableItem.Handle style={styles.dragHandle}>
|
|
320
|
-
<Text>โฎโฎ</Text>
|
|
321
|
-
</SortableItem.Handle>
|
|
322
|
-
</View>
|
|
323
|
-
</SortableItem>
|
|
324
|
-
);
|
|
411
|
+
### Sortable Grid
|
|
412
|
+
|
|
413
|
+
```tsx
|
|
414
|
+
import { SortableGrid, SortableGridItem } from "react-native-reanimated-dnd";
|
|
415
|
+
|
|
416
|
+
const apps = [
|
|
417
|
+
{ id: "1", label: "Photos" },
|
|
418
|
+
{ id: "2", label: "Music" },
|
|
419
|
+
{ id: "3", label: "Settings" },
|
|
420
|
+
{ id: "4", label: "Mail" },
|
|
421
|
+
];
|
|
422
|
+
|
|
423
|
+
function AppGrid() {
|
|
424
|
+
const renderItem = useCallback((props) => {
|
|
425
|
+
const { item, id, ...rest } = props;
|
|
426
|
+
return (
|
|
427
|
+
<SortableGridItem key={id} id={id} {...rest}>
|
|
428
|
+
<View style={styles.gridItem}>
|
|
429
|
+
<Text>{item.label}</Text>
|
|
430
|
+
</View>
|
|
431
|
+
</SortableGridItem>
|
|
432
|
+
);
|
|
433
|
+
}, []);
|
|
325
434
|
|
|
326
435
|
return (
|
|
327
|
-
<
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
style={{ flex: 1, padding: 16 }}
|
|
333
|
-
/>
|
|
334
|
-
</GestureHandlerRootView>
|
|
436
|
+
<SortableGrid
|
|
437
|
+
data={apps}
|
|
438
|
+
renderItem={renderItem}
|
|
439
|
+
dimensions={{ columns: 4, itemWidth: 80, itemHeight: 80, rowGap: 12, columnGap: 12 }}
|
|
440
|
+
/>
|
|
335
441
|
);
|
|
336
442
|
}
|
|
337
443
|
```
|
|
338
444
|
|
|
339
|
-
|
|
445
|
+
> **More examples:** [Quick Start Guide](https://reanimated-dnd-docs.vercel.app/docs/getting-started/quick-start) ยท [Sortable Lists](https://reanimated-dnd-docs.vercel.app/docs/examples/sortable-lists) ยท [Sortable Grids](https://reanimated-dnd-docs.vercel.app/docs/api/components/sortable-grid) ยท [All Examples](https://reanimated-dnd-docs.vercel.app/docs/examples/basic-drag-drop)
|
|
340
446
|
|
|
341
|
-
|
|
447
|
+
## ๐ Documentation
|
|
342
448
|
|
|
343
|
-
|
|
449
|
+
Visit **[reanimated-dnd-docs.vercel.app](https://reanimated-dnd-docs.vercel.app/)** for the full documentation:
|
|
344
450
|
|
|
345
|
-
|
|
451
|
+
- **[Getting Started](https://reanimated-dnd-docs.vercel.app/docs/getting-started/installation)** โ Installation, setup, and quick start
|
|
452
|
+
- **[Components](https://reanimated-dnd-docs.vercel.app/docs/api/components/draggable)** โ Draggable, Droppable, Sortable, SortableGrid, SortableItem
|
|
453
|
+
- **[Hooks](https://reanimated-dnd-docs.vercel.app/docs/api/hooks/useDraggable)** โ useDraggable, useDroppable, useSortable, useGridSortable
|
|
454
|
+
- **[Guides](https://reanimated-dnd-docs.vercel.app/docs/guides/animations)** โ Animations, collision algorithms, performance, accessibility
|
|
455
|
+
- **[Examples](https://reanimated-dnd-docs.vercel.app/docs/examples/basic-drag-drop)** โ Interactive code examples for every feature
|
|
456
|
+
- **[API Reference](https://reanimated-dnd-docs.vercel.app/docs/api/overview)** โ Complete types, enums, and utilities
|
|
346
457
|
|
|
347
|
-
|
|
348
|
-
<Draggable
|
|
349
|
-
data={any} // Data associated with the item
|
|
350
|
-
onDragStart={(data) => void} // Called when dragging starts
|
|
351
|
-
onDragEnd={(data) => void} // Called when dragging ends
|
|
352
|
-
onDragging={(position) => void} // Called during dragging
|
|
353
|
-
onStateChange={(state) => void} // Called on state changes
|
|
354
|
-
dragDisabled={boolean} // Disable dragging
|
|
355
|
-
collisionAlgorithm="center|intersect|contain" // Collision detection method
|
|
356
|
-
dragAxis="x|y|both" // Constrain movement axis
|
|
357
|
-
dragBoundsRef={RefObject} // Boundary container reference
|
|
358
|
-
animationFunction={(toValue) => Animation} // Custom animation function
|
|
359
|
-
style={StyleProp<ViewStyle>} // Component styling
|
|
360
|
-
>
|
|
361
|
-
{children}
|
|
362
|
-
</Draggable>
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
#### `<Droppable>`
|
|
458
|
+
## ๐โโ๏ธ Running the Example App
|
|
366
459
|
|
|
367
|
-
|
|
460
|
+
1. Clone the repository:
|
|
368
461
|
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
onActiveChange={(isActive) => void} // Called on hover state change
|
|
373
|
-
dropDisabled={boolean} // Disable drop functionality
|
|
374
|
-
dropAlignment="top-left|center|bottom-right|..." // Drop positioning
|
|
375
|
-
dropOffset={{ x: number, y: number }} // Position offset
|
|
376
|
-
activeStyle={StyleProp<ViewStyle>} // Style when active
|
|
377
|
-
capacity={number} // Maximum items allowed
|
|
378
|
-
droppableId={string} // Unique identifier
|
|
379
|
-
>
|
|
380
|
-
{children}
|
|
381
|
-
</Droppable>
|
|
462
|
+
```bash
|
|
463
|
+
git clone https://github.com/entropyconquers/react-native-reanimated-dnd.git
|
|
464
|
+
cd react-native-reanimated-dnd
|
|
382
465
|
```
|
|
383
466
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
High-level component for sortable lists with auto-scrolling.
|
|
467
|
+
2. Install dependencies (uses npm workspaces):
|
|
387
468
|
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
data={Array<{ id: string }>} // Array of items to render
|
|
391
|
-
renderItem={(props) => ReactNode} // Render function for items
|
|
392
|
-
itemHeight={number} // Height of each item
|
|
393
|
-
itemKeyExtractor={(item) => string} // Custom key extractor
|
|
394
|
-
style={StyleProp<ViewStyle>} // List container style
|
|
395
|
-
contentContainerStyle={StyleProp<ViewStyle>} // Content container style
|
|
396
|
-
/>
|
|
469
|
+
```bash
|
|
470
|
+
npm install
|
|
397
471
|
```
|
|
398
472
|
|
|
399
|
-
|
|
473
|
+
3. Run the example app:
|
|
400
474
|
|
|
401
|
-
|
|
475
|
+
```bash
|
|
476
|
+
# iOS
|
|
477
|
+
npm run start --workspace example-app
|
|
478
|
+
# then press 'i' for iOS or 'a' for Android
|
|
402
479
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
data={any} // Item data
|
|
407
|
-
positions={SharedValue} // Position tracking
|
|
408
|
-
onMove={(id, from, to) => void} // Called when item moves
|
|
409
|
-
onDragStart={(id, position) => void} // Called when dragging starts
|
|
410
|
-
onDrop={(id, position) => void} // Called when item is dropped
|
|
411
|
-
onDragging={(id, overItemId, y) => void} // Called during dragging
|
|
412
|
-
style={StyleProp<ViewStyle>} // Item styling
|
|
413
|
-
animatedStyle={StyleProp<AnimatedStyle>} // Animated styling
|
|
414
|
-
>
|
|
415
|
-
{children}
|
|
416
|
-
</SortableItem>
|
|
480
|
+
# Or run directly:
|
|
481
|
+
npx expo run:ios --cwd example-app
|
|
482
|
+
npx expo run:android --cwd example-app
|
|
417
483
|
```
|
|
418
484
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
#### `useDraggable(options)`
|
|
422
|
-
|
|
423
|
-
Core hook for implementing draggable functionality.
|
|
424
|
-
|
|
425
|
-
#### `useDroppable(options)`
|
|
426
|
-
|
|
427
|
-
Core hook for implementing droppable functionality.
|
|
428
|
-
|
|
429
|
-
#### `useSortable(options)`
|
|
430
|
-
|
|
431
|
-
Hook for individual sortable items with position management.
|
|
432
|
-
|
|
433
|
-
#### `useSortableList(options)`
|
|
434
|
-
|
|
435
|
-
Hook for managing entire sortable lists with auto-scrolling.
|
|
485
|
+
**Note:** Reanimated 4 requires the New Architecture, so you must use a development build (`npx expo run:ios` / `npx expo run:android`), not Expo Go.
|
|
436
486
|
|
|
437
|
-
|
|
487
|
+
The example app includes all 18 interactive examples showcasing every feature of the library.
|
|
438
488
|
|
|
439
|
-
|
|
489
|
+
## ๐บ๏ธ Project Roadmap
|
|
440
490
|
|
|
441
|
-
|
|
491
|
+
I am constantly working to improve React Native Reanimated DnD. Here's what's coming next:
|
|
442
492
|
|
|
443
|
-
|
|
444
|
-
<DropProvider>{/* All draggable and droppable components */}</DropProvider>
|
|
445
|
-
```
|
|
493
|
+
### โ
v2.0.0 (Current)
|
|
446
494
|
|
|
447
|
-
|
|
495
|
+
**Reanimated 4 + Worklets Migration**
|
|
448
496
|
|
|
449
|
-
|
|
497
|
+
- ๐ **Reanimated 4 & Worklets** - Migrated from Reanimated 3 to Reanimated 4 with react-native-worklets
|
|
498
|
+
- ๐๏ธ **New Architecture** - Built for React Native's New Architecture (required by Reanimated 4)
|
|
499
|
+
- ๐ฆ **Expo SDK 55** - Tested and compatible with Expo SDK 55 and React Native 0.83
|
|
500
|
+
- ๐ง **Handle Registration** - Replaced tree-walking handle detection with a registration pattern
|
|
501
|
+
- โก **Improved Scheduling** - Uses `scheduleOnRN`/`scheduleOnUI` for better worklet-to-JS communication
|
|
502
|
+
- ๐ฏ **Pre-drag Delay** - New `preDragDelay` prop for distinguishing taps from drags
|
|
503
|
+
- ๐ **npm Workspaces** - Example app now uses workspace-based development setup
|
|
504
|
+
- ๐ฒ **Sortable Grids** - 2D grid drag-and-drop with flexible layouts and insert/swap modes
|
|
505
|
+
- โ **Dynamic Heights** - Sortable list support for variable item heights
|
|
450
506
|
|
|
451
|
-
|
|
452
|
-
enum DraggableState {
|
|
453
|
-
IDLE = "idle",
|
|
454
|
-
DRAGGING = "dragging",
|
|
455
|
-
ANIMATING = "animating",
|
|
456
|
-
}
|
|
457
|
-
```
|
|
507
|
+
### ๐ฏ Next Release
|
|
458
508
|
|
|
459
|
-
|
|
509
|
+
**Focus: Enhanced Functionality & New Features**
|
|
460
510
|
|
|
461
|
-
|
|
462
|
-
type CollisionAlgorithm = "center" | "intersect" | "contain";
|
|
463
|
-
```
|
|
511
|
+
- ๐ **Bug Fixes & Issues Resolution**
|
|
464
512
|
|
|
465
|
-
|
|
513
|
+
- Address existing reported issues
|
|
514
|
+
- Performance optimizations
|
|
515
|
+
- Gesture handling improvements
|
|
516
|
+
- API Improvements
|
|
466
517
|
|
|
467
|
-
|
|
468
|
-
type DropAlignment =
|
|
469
|
-
| "top-left"
|
|
470
|
-
| "top-center"
|
|
471
|
-
| "top-right"
|
|
472
|
-
| "center-left"
|
|
473
|
-
| "center"
|
|
474
|
-
| "center-right"
|
|
475
|
-
| "bottom-left"
|
|
476
|
-
| "bottom-center"
|
|
477
|
-
| "bottom-right";
|
|
478
|
-
```
|
|
518
|
+
- ๐ช **Nested Sortable Lists**
|
|
479
519
|
|
|
480
|
-
|
|
520
|
+
- Multi-level hierarchy support
|
|
521
|
+
- Collapse/expand functionality
|
|
522
|
+
- Parent-child relationship management
|
|
523
|
+
- Tree-like data structure handling
|
|
481
524
|
|
|
482
|
-
|
|
525
|
+
- ๐ **Kanban Board Support**
|
|
526
|
+
- Cross-list dragging capabilities
|
|
527
|
+
- Multiple column support
|
|
528
|
+
- Inter-list item transfer
|
|
529
|
+
- Board-level state management
|
|
483
530
|
|
|
484
|
-
|
|
485
|
-
import { withTiming, withSpring, Easing } from "react-native-reanimated";
|
|
486
|
-
|
|
487
|
-
// Smooth timing animation
|
|
488
|
-
const smoothAnimation = (toValue) => {
|
|
489
|
-
"worklet";
|
|
490
|
-
return withTiming(toValue, {
|
|
491
|
-
duration: 300,
|
|
492
|
-
easing: Easing.bezier(0.25, 0.1, 0.25, 1),
|
|
493
|
-
});
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
// Spring animation
|
|
497
|
-
const springAnimation = (toValue) => {
|
|
498
|
-
"worklet";
|
|
499
|
-
return withSpring(toValue, {
|
|
500
|
-
damping: 15,
|
|
501
|
-
stiffness: 150,
|
|
502
|
-
});
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
<Draggable animationFunction={springAnimation}>{/* content */}</Draggable>;
|
|
506
|
-
```
|
|
531
|
+
### ๐ก Community Requests
|
|
507
532
|
|
|
508
|
-
|
|
533
|
+
Vote on features you'd like to see by raising an issue.
|
|
509
534
|
|
|
510
|
-
|
|
511
|
-
// Precise center-point collision
|
|
512
|
-
<Draggable collisionAlgorithm="center">
|
|
513
|
-
{/* Requires center point to be over drop zone */}
|
|
514
|
-
</Draggable>
|
|
515
|
-
|
|
516
|
-
// Forgiving intersection collision (default)
|
|
517
|
-
<Draggable collisionAlgorithm="intersect">
|
|
518
|
-
{/* Any overlap triggers collision */}
|
|
519
|
-
</Draggable>
|
|
520
|
-
|
|
521
|
-
// Strict containment collision
|
|
522
|
-
<Draggable collisionAlgorithm="contain">
|
|
523
|
-
{/* Entire draggable must be within drop zone */}
|
|
524
|
-
</Draggable>
|
|
525
|
-
```
|
|
535
|
+
**Have an idea?** [Open a feature request](https://github.com/entropyconquers/react-native-reanimated-dnd/issues/new?assignees=&labels=enhancement&template=feature_request.md) and let me know!
|
|
526
536
|
|
|
527
|
-
|
|
537
|
+
## ๐ค AI Integration Skill
|
|
528
538
|
|
|
529
|
-
|
|
530
|
-
<SortableItem id={item.id} {...props}>
|
|
531
|
-
<View style={styles.itemContainer}>
|
|
532
|
-
<Text>{item.title}</Text>
|
|
533
|
-
|
|
534
|
-
{/* Only this handle area can initiate dragging */}
|
|
535
|
-
<SortableItem.Handle style={styles.dragHandle}>
|
|
536
|
-
<View style={styles.handleIcon}>
|
|
537
|
-
<View style={styles.dot} />
|
|
538
|
-
<View style={styles.dot} />
|
|
539
|
-
<View style={styles.dot} />
|
|
540
|
-
</View>
|
|
541
|
-
</SortableItem.Handle>
|
|
542
|
-
</View>
|
|
543
|
-
</SortableItem>
|
|
544
|
-
```
|
|
539
|
+
Speed up development with the official [agent skill](https://agentskills.io). It teaches AI coding agents (Claude Code, Codex, Cursor, Gemini CLI, Copilot, and 30+ more) the full API so they generate correct code โ no hallucinated props.
|
|
545
540
|
|
|
546
|
-
|
|
541
|
+
```bash
|
|
542
|
+
# Install via npx skills (auto-detects your agents)
|
|
543
|
+
npx skills add entropyconquers/react-native-reanimated-dnd
|
|
547
544
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
<View ref={containerRef} style={styles.container}>
|
|
552
|
-
<Draggable
|
|
553
|
-
data={data}
|
|
554
|
-
dragBoundsRef={containerRef}
|
|
555
|
-
dragAxis="x" // Constrain to horizontal movement
|
|
556
|
-
>
|
|
557
|
-
{/* content */}
|
|
558
|
-
</Draggable>
|
|
559
|
-
</View>;
|
|
545
|
+
# Or install globally
|
|
546
|
+
npx skills add entropyconquers/react-native-reanimated-dnd -g
|
|
560
547
|
```
|
|
561
548
|
|
|
562
|
-
|
|
549
|
+
Once installed, just describe what you want:
|
|
563
550
|
|
|
564
|
-
|
|
565
|
-
<Droppable
|
|
566
|
-
capacity={3}
|
|
567
|
-
onDrop={(data) => {
|
|
568
|
-
if (currentItems.length < 3) {
|
|
569
|
-
addItem(data);
|
|
570
|
-
}
|
|
571
|
-
}}
|
|
572
|
-
activeStyle={{
|
|
573
|
-
backgroundColor: currentItems.length < 3 ? "#e8f5e8" : "#ffe8e8",
|
|
574
|
-
}}
|
|
575
|
-
>
|
|
576
|
-
<Text>Drop Zone ({currentItems.length}/3)</Text>
|
|
577
|
-
</Droppable>
|
|
578
|
-
```
|
|
551
|
+
> "Add a sortable list where I can reorder items by dragging"
|
|
579
552
|
|
|
580
|
-
|
|
553
|
+
> "Create a drag and drop interface with drop zones"
|
|
581
554
|
|
|
582
|
-
|
|
555
|
+
> "Make a reorderable 3-column grid"
|
|
583
556
|
|
|
584
|
-
|
|
585
|
-
git clone https://github.com/entropyconquers/react-native-reanimated-dnd.git
|
|
586
|
-
cd react-native-reanimated-dnd
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
2. Install dependencies:
|
|
557
|
+
Your agent will generate complete, working implementations with correct imports, props, and state management.
|
|
590
558
|
|
|
591
|
-
|
|
592
|
-
npm install
|
|
593
|
-
cd example-app
|
|
594
|
-
npm install
|
|
595
|
-
```
|
|
559
|
+
The skill ships in both `.claude/skills/` (Claude Code) and `.agents/skills/` (Codex, Cursor, Gemini CLI, Copilot, and others) for universal agent compatibility. See the [AI Integration Skill docs](https://reanimated-dnd-docs.vercel.app/docs/getting-started/ai-skill) for all installation options and the full agent compatibility table.
|
|
596
560
|
|
|
597
|
-
|
|
561
|
+
## ๐ค Contributing
|
|
598
562
|
|
|
599
|
-
|
|
600
|
-
# iOS
|
|
601
|
-
npx expo run:ios
|
|
563
|
+
Contributions are always welcome! We believe in building this library together with the community.
|
|
602
564
|
|
|
603
|
-
|
|
604
|
-
npx expo run:android
|
|
605
|
-
```
|
|
565
|
+
**Ways to contribute:**
|
|
606
566
|
|
|
607
|
-
|
|
567
|
+
- ๐ Report bugs and issues
|
|
568
|
+
- โจ Suggest new features
|
|
569
|
+
- ๐ง Submit pull requests
|
|
570
|
+
- ๐ Improve documentation
|
|
571
|
+
- ๐งช Write tests
|
|
572
|
+
- ๐ฌ Help others in discussions
|
|
608
573
|
|
|
609
|
-
|
|
574
|
+
Please see our [**Contributing Guide**](CONTRIBUTING.md) for detailed information on:
|
|
610
575
|
|
|
611
|
-
|
|
576
|
+
- Setting up the development environment
|
|
577
|
+
- Code style guidelines
|
|
578
|
+
- Pull request process
|
|
579
|
+
- Testing requirements
|
|
580
|
+
- Community guidelines
|
|
612
581
|
|
|
613
582
|
## ๐ License
|
|
614
583
|
|
|
@@ -621,12 +590,30 @@ MIT ยฉ [Vishesh Raheja](https://github.com/entropyconquers)
|
|
|
621
590
|
- Inspired by the React ecosystem's drag-and-drop libraries
|
|
622
591
|
- Special thanks to the React Native community for feedback and contributions
|
|
623
592
|
|
|
593
|
+
## โ Support the Project
|
|
594
|
+
|
|
595
|
+
<div align="center">
|
|
596
|
+
<body>
|
|
597
|
+
If this library has helped you build amazing apps, consider supporting its development!
|
|
598
|
+
</br></br>
|
|
599
|
+
<a href="https://www.buymeacoffee.com/entropyconquers" target="_blank">
|
|
600
|
+
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me a Coffee" style="height: 60px; width: 217px;">
|
|
601
|
+
</a>
|
|
602
|
+
</br>
|
|
603
|
+
</br>
|
|
604
|
+
Your support helps maintain and improve this library for the entire React Native community! ๐
|
|
605
|
+
</body>
|
|
606
|
+
</html>
|
|
607
|
+
|
|
608
|
+
</div>
|
|
609
|
+
<br/>
|
|
610
|
+
|
|
624
611
|
---
|
|
625
612
|
|
|
626
613
|
<div align="center">
|
|
627
614
|
|
|
628
615
|
**Made with โค๏ธ for the React Native community**
|
|
629
616
|
|
|
630
|
-
[โญ Star on GitHub](https://github.com/entropyconquers/react-native-reanimated-dnd) โข [๐ฑ Try the Demo](https://github.com/entropyconquers/react-native-reanimated-dnd/tree/main/example-app) โข [๐ Documentation](https://
|
|
617
|
+
[โญ Star on GitHub](https://github.com/entropyconquers/react-native-reanimated-dnd) โข [๐ฑ Try the Demo](https://github.com/entropyconquers/react-native-reanimated-dnd/tree/main/example-app) โข [๐ Documentation](https://reanimated-dnd-docs.vercel.app/)
|
|
631
618
|
|
|
632
619
|
</div>
|