Skip to main content

Overview

Options

<DragDropContentView /> supports all <View /> Props. Other Props:

OptioniOSAndroidWebDescription
onDropA callback that returns an array of assets. Refer to Asset Object
onDragStartA callback that is called when the user starts dragging an asserts.
onDragEndA callback that is called when the users finger is released (successfully or not).
onEnterA callback that is called when any source is dragged into the view's boundary (hovering begins).
onExitA callback that is called when any source is dragged out of the view's boundary (hovering ends).
onDropListeningStartA callback that is called for all <DragDropContentView /> instances within the view port once any drag begins. Useful if you want to customize all drop areas as soon as any asset begins dragging. Refer to Example
includeBase64If true, includes the base64 data URL of the asset in the base64 field (avoid on large files due to performance).
draggableSourcesSources that can be dragged around the screen. Refer to Draggable Source.
allowedMimeTypesAn array of mime types that are allowed to be dropped.

Asset Object

keyiOSAndroidWebDescription
base64The base64 data URL of the asset. Included when includeBase64 is true.
uriThe file uri. On Android and iOS this is the app-specific cache storage URI. On web this is a blob URI (URL.createObjectURL). Not present for plain-text drops.
releaseRevokes the blob URI. Not called automatically — call asset.release?.() when done, or use useDropAssets() for automatic cleanup. uri is invalid after calling.
pathThe original file path.
widthAsset dimensions
heightAsset dimensions
typeThe file mime type
fileNameThe file name
textIf the dropped file is text, this key contains its value

Draggable Source

keyiOSAndroidWebDescription
typeimage, video, text or file
valueFor image, video or file: pass a file URI on iOS/Android, or a base64 data URL on web. For text, pass the text value.