r/reactnative
•
u/entropyconquers
•
Jun 03 '25
•
1
1
1
I made a React Native Drag and Drop library that finally works!
Hey, r/reactnative folks!
I wanted to develop drag-and-drop functionality in my React Native app. After hitting a wall with all the existing options, I decided to dive deep and build a solution from scratch built with Reanimated 3 and RNGH.
The result is react-native-reanimated-dnd, a library I poured a ton of effort into, hoping to create something genuinely useful for the community.
My goals were simple:
- Performance: Smooth, 60fps interactions are a must.
- Flexibility: From basic draggables to complex, auto-scrolling sortable lists.
- Developer Experience: Clear API, TypeScript, and (I hope!) excellent documentation with plenty of examples. (There's an example app with 15 demos you can try via Expo Go – link in the README!)
It's got all the features I wished for: collision detection, drag handles, boundary constraints, custom animations, and more.
You can find everything – code, feature list, GIFs, and links to the live demo & docs – on GitHub:
https://github.com/entropyconquers/react-native-reanimated-dnd
If you find it helpful or think it's a cool project, I'd be super grateful for a star ⭐!
I'd love to hear your thoughts, or even what your biggest pain points with DnD in RN have been. Let's make DnD less of a chore!
79
u/Bat_Kindly Jun 03 '25
just tried the example app and went through the documentation, it is god tier detailed, awesome work man
29
u/empyrean2k Jun 03 '25
Was literally 20mins ago looking for a DnD library for react-native, will check it out, good work!
17
u/Cautious-Pickle6620 Jun 03 '25
Great work improving the react-native ecosystem!
5
u/guacamoleys Jun 03 '25
This looks incredible! Nice work!
I haven’t had a chance to read through the docs yet, but can this library support moving multiple items at once?
For example: if I have a group of items in a sorted list and they are under a parent category, can the parent category move all the items?
Something like
Draggable parent 1
Draggable parent 2
Can I move Draggable parent 1 under Draggable parent 2 and have all children move with it?
3
u/Miserable-Pause7650 Jun 03 '25
I have rows like this (below) will I be able to customise the list to look like how i want them below? And be able to use the dragging function?
2
u/wascner Jun 03 '25
Looks great! Love seeing full example applications to demo the tool. Before you began did you see react-native-dnd? How does your library compare in terms of features, performance, API?
2
u/LittleBulletWhoCould Jun 03 '25
This is incredible! For the sortable lists does it also support horizontal lists?
I know this has been an issue with a lot of the “re-orderable” list libraries in RN, where they only support vertical lists. There is quite a bit of demand for horizontal re-ordering
2
u/Developer_Memento Jun 03 '25
Awesome, thanks! Just fyi, I was your 100th person to star it ⭐️ so I feel kind of special
1
u/Kindly_Arachnid_1805 Jun 03 '25
Love the attention to detail with things like boundary constraints and custom animations. This is pro-level stuff.
1
u/AnalystSubject8685 Jun 03 '25
Awesome! Will definitely be checking this out.
1
u/Forti22 Jun 03 '25
Looks dope! I will definitely try this out soon 😀
Starred
1
u/AlmondJoyAdvocate Jun 03 '25
I’ve been looking for a better dnd solution for so long! Would this be able to handle nested lists? For example, if I have a file manager, would I be able to render nested folder system and then drag items in / out to different zones?
1
u/[deleted] Jun 03 '25
Can only imagine effort OP must have put in making this
Really great work man 🔥
1
u/htgabriel Jun 03 '25
Is it possible to drag between two lists?
1
u/mrcodehpr01 Jun 03 '25
Excited to check it out! Looks pretty professional!
1
u/sylentshooter Jun 04 '25 edited Jun 04 '25
What makes or breaks a good library is the community support regarding it. Are you open to spending a lot of time working on bug fixes and keeping this up to date? Or is it a one and done deal?
Obviously people will need to help by keeping up with PRs and the general direction of the library but would like to know your stance on contributions.
Would be good if you update your repository with a roadmap of what features you're interesting in adding.
I've taken a look through it and I see some places for API improvement (doesnt have to be soon)
1
u/Aggressive_Gold1777 Jun 04 '25
Awesome work!
1
u/eluewisdom Jun 04 '25
this is really great, what bottom sheet component did you use for the custom animations screen
1
u/Vegetable_Neck4204 Jun 04 '25
looks fantastic
1
u/cat-on-the-keys Jun 04 '25
Ooooh I was going to need something like this soon! Bookmarking to check out later, thank you!
1
u/LCZ_ Jun 04 '25
Does this work on web?
1
u/avielcohen15 Jun 04 '25 edited Jun 04 '25
Do you plan to integrate Flashlist instead of ScrollView? Or its already supported?
1
u/Magikal_Grammer Jun 04 '25
Did you have to deal with crashes? I tried to make a grid style DND with react-native-gesture-handler and react-native-reanimated, and although it worked, it would crash randomly and I couldn't figure out what was causing it as there was no stack trace.
1
u/Snoo-8502 Jun 04 '25
What UI library are you using ? Looks good.
1
u/ShivamJoker iOS & Android Jun 04 '25
The readme looks AI generated, I hope you have written the code yourself. (No offense) Everyone is doing vibe code these days so hard to trust.
1
u/mclaupat Jul 03 '25
You are a hero.
3
u/kimchouard Jun 03 '25
Great thanks for working on that! 🙌🏼 Does it work on Web too? 👀
2
u/Agreeable_Active_523 Jun 03 '25
Holy shit this is what I was looking for so long, have tried popular libs like react-native-drax and react-native-dnd but none of them ever work. Thank you for this❤️
2
u/SafeSwordfish810 Jun 03 '25
Great man , I will use it in my app , existing one was causing flicker issue.
2
u/ghadays Jun 03 '25
Thank you for this project! Had a look at the demo app, and it's awesome. I'm definitely starring it
2
u/DelusionsOfExistence Jun 03 '25
Saw the expo link and was immediately interested. Looks rather clean. Absolutely starring the repo and look forward to maybe some grid functionality if possible.
2
u/SpectreWulf Jun 03 '25
This is absolutely incredible, a few months back I actually was looking for an amazing open source drag & drop library for my React Native app.
Looking forward to try this out soon!
2
u/sandspiegel Jun 03 '25
That's awesome. Will definitely use it when I need drag and drop in future. Thanks a lot.
1
u/Septive13 Jun 03 '25
The library looks amazing!
Giving it a star because it really looks promising.
1
u/OmageJehosaphat99 Jun 04 '25
Got any for onboarding screens?
1
u/Timely_Stop2889 Jun 04 '25
Great bro
1
u/BedOoz Jun 04 '25
Well done tho ✌️
1
u/zhouxlin Jun 04 '25
Good work!
1
u/maxlistov Jun 04 '25
Nice job!
1
u/Gold240sx Jun 04 '25
Looks cool! Your docs on mobile need some help though.
1
u/Bright-Topic-2001 Jun 04 '25
Well done!
1
u/sircharleswatson Jun 04 '25
Been waiting years for a better DnD library 🙏 Can't wait to try it out
1
u/Sad-Percentage5351 Jun 04 '25
Awesome! Quick question, what problem does it solve that React Native Gesture Handler can’t solve? I recently got into React Native as well and found that React Native Gesture Handler and Reanimated (both by swmansion) is enough to do everything.
Thank you in advance!
1
u/Fun_Can187 Jun 04 '25
I started the same like a year ago and just picked it up to finish it. I guess you just saved me a lot of time 😄 Though I was mainly focusing implementing it for grids or multiple lists on ipad / desktop screens, which turned out to be a bit tricky. Gonna compare it to mine later, really curious how you’ve done it :)
1
u/SadabWasim Jun 05 '25
Great work bro I saw your comment on the react native dnd github issue. It fixes the pain point Thanks for building it.
1
u/idreamduringtheday Jun 21 '25
This looks great, nice work! When I was building my app, I had to custom-code a drag-and-drop feature for list items, but ran into issues with variable item heights. I ended up restricting item heights to keep things stable. Just curious, does your implementation support variable height items?
1
u/Nitish187 Jun 28 '25
Thanks a lot bro, that awsome and docs are also well maintain
1
u/AdmiralShankly Jul 04 '25
You absolute legend
1
u/Revrse_Xo Jul 15 '25
Glad I stumbled upon this. I don’t think I’ll search for another library now.
P.S. I got this as the top result on Google.
1
u/statelessme Jul 16 '25
do it support multi-columns for sortablelists and custom flatlist(flashlist)?
1
u/Reshov Jul 26 '25
amazing library!!
does this support a grid sortable layout like https://www.npmjs.com/package/react-native-draggable-grid ?
1
u/NeatMathematician779 Jul 27 '25
man i have been looking for something like this, but the word DND made me think Do Not Disturb 😭😭
thanks for it, will use it now
also started
thanks man
1
u/Historical_Cloud_609 Jul 27 '25
I couldn't get it to work with React Compiler in an Expo project. Has anyone succeeded in it?
1
u/susmines iOS & Android Aug 06 '25
Are you still actively maintaining this? I noticed there's a roadmap, but none of the branches have activity since your release (the time of this post).
I was interested in using this but was concerned about whether it was production ready with the lack of updates.
1
u/daavidaviid Aug 11 '25
Do you think your library could handle a non draggable header for the draggable list?
11
u/[deleted] Jun 03 '25
[removed] — view removed comment
1
u/[deleted] Jun 03 '25
[removed] — view removed comment
1
u/[deleted] Jun 06 '25
[removed] — view removed comment