react-draggable-snap react js drag box demo, when box near another box, it will snap to it. Demo on CodeSandbox