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
- Kotlin
- Dart
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,
)
| Name | Type | Default |
|---|---|---|
files | List<UploadFile> | required |
onPick | () -> Unit | required |
onRemove | (UploadFile) -> Unit | required |
label | String | required |
modifier | Modifier | Modifier |
dropTarget | ((DropTargetCallbacks) -> Modifier)? | null |
onFilesDropped | ((List<DroppedFile>) -> Unit)? | null |
onRetry | ((UploadFile) -> Unit)? | null |
hint | String? | null |
enabled | Boolean | true |
Design notes
Why CamoFileUploader works this way, its states and its edge cases: contributor docs.