v14.2.0

Playroom

Github

DragDrop

View Source

Custom components that wrap react-beautiful-dnd. Uses the same API exported under Provider, Droppable, and Draggable components.

Profile

Check-In

Home

Groups

Events

Search

Copy
Edit

Props

Please refer to react-beautiful-dnd for documentation on events and setting up drag and drop lists. In addition to the default functionality provided, we augment the library with the following props:

DragDrop.Droppable

onDragStart: (event) => void

Called at the start of a child Draggable drag.

onDragEnd: (event) => void

Called at the end of a child Draggable drag.

onDrop: (event) => void

This function will be called when a Draggable has been dropped. Returns the onDragEnd event with any Draggable data attached.

sourceOnly: boolean

This prop controls whether or not the droppable can receive and reorder draggables. If true, draggables may move outside the droppable, but not added.

DragDrop.Draggable

data: any

An additional data prop has been added to flow data more easily between components that will be attached to the onDragEnd and onDrop events.

placeholder: () => React.ReactNode

The placeholder prop allows a custom placeholder to be rendered when used in conjunction with the sourceOnly prop on Droppable.

  • Props
  • DragDrop.Droppable
  • DragDrop.Draggable
PreviousDividerNextDrawer