DragAndDrop
DragAndDrop adds support for the reordering of items in a list using drag and drop, as well as move dialogs.
Internal Component
This component is intended solely for use within GitHub and is not available for external use.React
ready
Props
DragAndDrop
| Name | Default | Description |
|---|---|---|
items Required | K[]Array of ids and titles of the items | |
direction | DragAndDropDirectionDirection of the list, defaults to vertical | |
onDrop Required | (args: OnDropArgs<T>) => voidCallback called when a drop occurs | |
as | React.ElementType<any, keyof React.JSX.IntrinsicElements>Component type to render for drag and drop container | |
renderOverlay Required | (item: K, index: number) => React.ReactNodeRender function for overlay | |
keyboardCodes | KeyboardCodesKeyboard codes to use for drag and drop | |
enableTouch | booleanEnabled touch support for drag and drop. |
DragAndDropItem
| Name | Default | Description |
|---|---|---|
index Required | numberThe index of the list item | |
containerStyle | React.CSSPropertiesSx to apply to the container | |
hideTrigger | booleanWhether or not to hide the trigger, only use when defining a custom trigger. | |
role | React.AriaRoleThe role of the list item | |
as | React.ElementType<any, keyof React.JSX.IntrinsicElements>Component type to render for drag and drop container | |
isDragOverlay | booleanWhether or not the item is a drag overlay | |
itemClassName | stringStyling for the item nested inside the | |
elementId | stringHTML id for the list item |