Draggable

Default


The Draggable kit gives you a full subcomponent structure that allows it to be used with almost any kits.

DraggableProvider = This provider manages all settings that allows drag and drop to function and must be used as the outermost wrapper. It has 2 REQUIRED props: initialItems (initial data) and onReorder (function that returns mutated data as items are reordered via drag and drop). Devs must manage state as shown.

Draggable.Container = This specifies the container within which items can be dropped.
Draggable.Item = This specifies the items that can be dragged and dropped. dragId is a REQUIRED prop for Draggable.Item.

Draggable with List Kit


For a simplified version of the Draggable API for the List kit, you can do the following:

Use DraggableProvider and manage state as shown.

The List kit is optimized to work with the draggable kit. To enable drag, use the enableDrag prop on List kit AND dragId prop on ListItem. An additional optional boolean prop (set to true by default) of dragHandle is also available on List kit to show the drag handle icon.

Draggable with SelectableList Kit


For a simplified version of the Draggable API for the SelectableList kit, you can do the following:

Use DraggableProvider and manage state as shown.

The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the enableDrag prop on SelectableList kit AND dragId prop on SelectableList.Item. An additional optional boolean prop (set to true by default) of dragHandle is also available on SelectableList kit to show the drag handle icon.

Draggable with Cards


For a simplified version of the Draggable API for the Card kit, you can do the following:

Use DraggableProvider and manage state as shown.

Draggable.Container creates the container within which the cards can be dragged and dropped.

The Card kit is optimized to work with the draggable kit. To enable drag, use the draggableItem and dragId props on the Card kit as shown. An additional optional boolean prop (set to true by default) of dragHandle is also available to show the drag handle icon.

Dragging Across Multiple Containers


The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.


Available Props