media/DSFileUpload
DSFileUpload
mediaDrag-and-drop / tap-to-browse file input with allowed type filtering, size limit, and progress overlay.
iOS 17+macOS 14+
Purpose
Document upload, attachment areas in forms, and asset import flows.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| filesreq | Binding<[URL]> | โ | Bound array of selected file URLs. |
| allowedTypes | [UTType] | [.data] | Accepted file content types. |
| maxFileSizeMB | Double? | nil | File size limit. Shows an error if exceeded. |
| allowsMultiple | Bool | true | Allow selecting more than one file. |
| label | String | "Drop files here or click to browse" | Empty state label. |
Examples
Document upload
PDF/image upload in a support ticket form.
swift
DSFileUpload(
files: $attachments,
allowedTypes: [.pdf, .image],
maxFileSizeMB: 10,
label: "Attach documents"
)