Drag and drop is an action, which means grabbing an object to a different location. The components capable of being dragged and dropped enrich the web and make a solid base for modern UI patterns. The drag-and-drop utilities in PrimeNG allow us to create draggable and droppable user interfaces efficiently. They make it abstract for the developers to deal with the implementation details at the browser level.
In this section, you will learn about the pDraggable and pDroppable directives. We will introduce a DataGrid component containing some imaginary documents and make these documents draggable in order to drop them onto a recycle bin. The recycle bin is implemented as a DataTable component, which shows properties of dropped documents. For the purpose of better understanding the developed code, a picture comes first:
This picture shows what happens after dragging and dropping three documents.