Package-level declarations

Types

Link copied to clipboard
data class DroppedImage(val bytes: ByteArray, val intrinsicSize: Size, val dropPositionScreen: Offset)

A single image extracted from a drag-and-drop event.

Functions

Link copied to clipboard
actual fun Modifier.imageDragAndDropTarget(onImagesDropped: (drops: List<DroppedImage>) -> Unit): Modifier

No-op on Android — touch platforms don't expose OS-level file drag-drop the same way Desktop does. The existing image picker covers this flow.

expect fun Modifier.imageDragAndDropTarget(onImagesDropped: (drops: List<DroppedImage>) -> Unit): Modifier

Attach an OS-level drag-and-drop target to a composable so files dropped onto it from Finder / Explorer / a browser tab get decoded and surfaced through onImagesDropped.

actual fun Modifier.imageDragAndDropTarget(onImagesDropped: (drops: List<DroppedImage>) -> Unit): Modifier

iOS drag-and-drop probe. Compose Multiplatform 1.11 exposes Modifier.dragAndDropTarget on iOS targets but doesn't (yet) surface a payload accessor on the DragAndDropEvent analogous to JVM's awtTransferable. Without DragData or nativeEvent, the contents of the drop session (an array of NSItemProviders in UIKit terms) aren't reachable through the Compose API.

actual fun Modifier.imageDragAndDropTarget(onImagesDropped: (drops: List<DroppedImage>) -> Unit): Modifier

No-op on legacy Kotlin/JS — same status as the WasmJS actual.

actual fun Modifier.imageDragAndDropTarget(onImagesDropped: (drops: List<DroppedImage>) -> Unit): Modifier

Attach an OS-level drag-and-drop target to a composable so files dropped onto it from Finder / Explorer / a browser tab get decoded and surfaced through onImagesDropped.

actual fun Modifier.imageDragAndDropTarget(onImagesDropped: (drops: List<DroppedImage>) -> Unit): Modifier

No-op on WasmJS. Investigated against Compose Multiplatform 1.11 — the androidx.compose.ui.draganddrop package doesn't expose either:

Link copied to clipboard
actual fun pasteImageFromClipboard(onLoaded: (bytes: ByteArray, intrinsicSize: Size) -> Unit)

Android clipboard paste. Reads ClipboardManager.primaryClip for an image URI (covers Files / Gallery / Photos "Copy" flows plus browser "Copy image" on most Chromium derivatives), resolves it through the application ContentResolver, and delivers the bytes + intrinsic pixel size on the main thread.

expect fun pasteImageFromClipboard(onLoaded: (bytes: ByteArray, intrinsicSize: Size) -> Unit)

Read a single image from the platform clipboard, if one is present.

actual fun pasteImageFromClipboard(onLoaded: (bytes: ByteArray, intrinsicSize: Size) -> Unit)

iOS clipboard paste — reads UIPasteboard.general for an image and delivers the encoded bytes plus intrinsic pixel size. Wired primarily for iPad with a hardware keyboard where Cmd+V is the natural paste shortcut; iPhone users without keyboards trigger this through a host-supplied toolbar button instead.

actual fun pasteImageFromClipboard(onLoaded: (bytes: ByteArray, intrinsicSize: Size) -> Unit)

Legacy Kotlin/JS implementation. Stays in fully-dynamic territory because Kotlin/JS's standard Promise<T> doesn't surface chained dynamic types cleanly through the .then() overloads — using js("...") keeps the Async Clipboard call chain in JS land where the API was designed.

actual fun pasteImageFromClipboard(onLoaded: (bytes: ByteArray, intrinsicSize: Size) -> Unit)

Read a single image from the platform clipboard, if one is present.

actual fun pasteImageFromClipboard(onLoaded: (bytes: ByteArray, intrinsicSize: Size) -> Unit)

Read a single image from the platform clipboard, if one is present.