I am trying to make a card that is draggable, which is layered on top of a grid, and when moved, I want it to snap to the different sections of the Grid
. I am able to create the grid with the columns and rows and also a draggable item, but I am not sure as to whether the snap to grid
is possible with Material UI. Is there a way to do this by using Material UI and ReactJS?
If not possible with Material UI, is there another dependency I can use to achieve this?
react-dnd
is compatible with Material UI and lets you create a drag layer and snap to a grid.
See react-dnd
's basic demo here
And here is how you can extend it to things like: snapping, grid constraints, render arbitrary child components, reordering children
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With