Skip to main content

Overview

Options​

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

OptioniOSAndroidWebDescription
onDrop✅✅✅A callback that returns an array of assets. Refer to Asset Object
onDragStart✅✅✅A callback that is called when the user starts dragging an asserts.
onDragEnd✅✅✅A callback that is called when the users finger is released (successfully or not).
onEnter✅✅✅A callback that is called when any source is dragged into the view's boundary (hovering begins).
onExit✅✅✅A callback that is called when any source is dragged out of the view's boundary (hovering ends).
onDropListeningStart❌✅❌A 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
includeBase64✅✅✅If true, includes the base64 data URL of the asset in the base64 field (avoid on large files due to performance).
draggableSources✅✅✅Sources that can be dragged around the screen. Refer to Draggable Source.
allowedMimeTypes✅✅✅An array of mime types that are allowed to be dropped.

Asset Object​

keyiOSAndroidWebDescription
base64✅✅✅The base64 data URL of the asset. Included when includeBase64 is true.
uri✅✅✅The 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.
release❌❌✅Revokes the blob URI. Not called automatically — call asset.release?.() when done, or use useDropAssets() for automatic cleanup. uri is invalid after calling.
path✅✅❌The original file path.
width✅✅✅Asset dimensions
height✅✅✅Asset dimensions
type✅✅✅The file mime type
fileName✅✅✅The file name
text✅✅✅If the dropped file is text, this key contains its value

Draggable Source​

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