media/DSFileUpload

DSFileUpload

media
since v2.0

Drag-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.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Props

PropTypeDefaultDescription
filesreqBinding<[URL]>โ€”Bound array of selected file URLs.
allowedTypes[UTType][.data]Accepted file content types.
maxFileSizeMBDouble?nilFile size limit. Shows an error if exceeded.
allowsMultipleBooltrueAllow selecting more than one file.
labelString"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"
)

Related Components