Skip to main content

CamoFileUploader

A drop zone and button for choosing files, with a list of each file's progress. Core opens no picker and reads no file (ADR-27): a click, Enter or Space on the zone calls onPick, where the app opens its picker; dropTarget lets the app wrap the zone with its platform's drop API. The app runs the uploads and reports them in files. The zone announces as one button with its hint; a row announces its name and state, and a failure is announced once. label names the zone.

API​

public fun CamoFileUploader(
files: List<UploadFile>,
onPick: () -> Unit,
onRemove: (UploadFile) -> Unit,
label: String,
modifier: Modifier = Modifier,
dropTarget: ((DropTargetCallbacks) -> Modifier)? = null,
onFilesDropped: ((List<DroppedFile>) -> Unit)? = null,
onRetry: ((UploadFile) -> Unit)? = null,
hint: String? = null,
enabled: Boolean = true,
)
NameTypeDefault
filesList<UploadFile>required
onPick() -> Unitrequired
onRemove(UploadFile) -> Unitrequired
labelStringrequired
modifierModifierModifier
dropTarget((DropTargetCallbacks) -> Modifier)?null
onFilesDropped((List<DroppedFile>) -> Unit)?null
onRetry((UploadFile) -> Unit)?null
hintString?null
enabledBooleantrue
Design notes

Why CamoFileUploader works this way, its states and its edge cases: contributor docs.