r/reactjs • • Oct 02 '26

Show /r/reactjs react-table-dnd 3.0: drag several rows at once, works with TanStack Table, no dependencies

I maintain react-table-dnd, a small library for reordering rows and columns in React tables by dragging. 3.0 is out.

What's new:

- Multi-select and group drag.

- Drag events: onDragStart, onDragOver, onDragEnd, onDragCancel.

- Virtual tables with 100k+ rows via u/tanstack/react-virtual

- TanStack Table guide and demo.

- Touch support, drag handles, locked rows and columns.

Under the hood, 3.0 is a rewrite of the drag engine of v2.x

Docs and live demos: https://samiodeh1337.github.io/react-table-dnd/

GitHub: https://github.com/samiodeh1337/react-table-dnd

Feedback welcome, Thanks!

18 Upvotes

16 comments sorted by

3

u/WeeJeWel Oct 02 '26

This looks absolutely gorgeous!

Can it also sort columns?

1

u/Character_Bus48 Oct 02 '26

Thanks! Of course you can drag columns and it will show the full preview of it

1

u/amayle1 Oct 02 '26

I don’t know when a user would want to reorder a table like this but this library does feel great on mobile.

1

u/Character_Bus48 Oct 02 '26

you can make list of cards same as other libs with one column, i will add examples in docs, and will support to move from container to other

1

u/Successful-Shock-802 Oct 02 '26

I tried the example on live examples, it looks and feels great, but when I tried to grap an item (this is on mobile), I have to wait longer than usual.

I think it is a performance problem rather than a long timer, cuz i tried the example on thr home page and it feels instant.

1

u/Character_Bus48 Oct 02 '26

Sorry I think it's the grip itself is small, and in home page it's the whole row

1

u/Successful-Shock-802 Oct 02 '26

Try to make it larger and tell me when you are done.

You can use some ::before and ::after to make the grip area larger without changing the size od the handle.

I spot something else, I selected more than one row and when i tried to drop them, it lagged around 2 second until it settled in its new places

2

u/Character_Bus48 Oct 02 '26

Thanks for your feedback, I have discovered also a bug about scrolling, all bug fixes will be delivered soon in 3.0.1

1

u/Successful-Shock-802 Oct 02 '26

Yep, I have seen some scrolling inconsistencies while playing around, but it was hard to describe lol.

1

u/Character_Bus48 Oct 02 '26

Yes, but i made my best to make it optimized with large data, it has zero renders while dragging.

1

u/Successful-Shock-802 Oct 03 '26

Drag and drop are complex, I know

1

u/KTownDaren Oct 08 '26 edited Oct 08 '26

This is such a fantastic implementation! Great work!

I am playing around with it, and I am wondering if dragging across to another table is implemented?

For example, how could I implement dragging rows to another TableContainer, or if that cannot he done, can I drag from another source and still take advantage of row-specific dragover and drop effects?

1

u/Arunajyothi_Jurado Oct 20 '26

locked rows/columns is a solid addition. does the lock apply during drag only or can you lock them from being selected too? that distinction matters a lot in practice imo

1

u/[deleted] Oct 02 '26

[removed] — view removed comment

3

u/amayle1 Oct 02 '26

Yeah honestly if this was just a generic drag and drop library I’d be into it, cause it does actually look and feel great.