Row Ordering (DnD) Feature Guide
Mantine React Table has exposes all the APIs necessary to enable rich row drag and drop features that you can easily build to meet your needs. This includes the ability to reorder rows, drag rows to other tables, or drag rows to other UI in your application.
This is not the Sorting Guide which is a different feature.
Relevant Table Options
# | Prop Name | Type | Default Value | More Info Links | |
---|---|---|---|---|---|
1 | |||||
2 | |||||
3 | Mantine ActionIcon Docs | ||||
4 | |||||
5 | |||||
Relevant State
Enable Row Ordering
A common use for row drag and drop is to allow users to reorder rows in a table. This can be done by setting the
enableRowOrdering
table option to true
, and then setting up an onDragEnd
event handler on the mantineRowDragHandleProps
table option.Move | First Name | Last Name | City |
---|---|---|---|
Dylan | Murray | East Daphne | |
Raquel | Kohler | Columbus | |
Ervin | Reinger | South Linda | |
Brittany | McCullough | Lincoln | |
Branson | Frami | Charleston |
1-5 of 5
Drag and Drop Rows to Other UI or Tables
The Drag and Drop features are not limited to just internally within the same table. You can use them to drag rows to other UI in your application, or even to other tables. This can be done by setting the
enableRowDragging
table option to true
, and then setting up an onDragEnd
event handler on the mantineRowDragHandleProps
table option to perform whatever logic you want to happen when a row is dropped.Nice List
Move | First Name | Last Name | City |
---|---|---|---|
Dylan | Murray | East Daphne | |
Raquel | Kohler | Columbus | |
Ervin | Reinger | South Linda |
1-3 of 3
Naughty List
Move | First Name | Last Name | City |
---|---|---|---|
Brittany | McCullough | Lincoln | |
Branson | Frami | Charleston |
1-2 of 2
View Extra Storybook Examples
Note: Drag and Drop is not currently supported on mobile touch devices.