Upload

Accessible file selection, drag and drop, validation, previews, progress, and retryable upload queues.

Upload

Complete flow

The default surface supports mouse, keyboard, and drag-and-drop selection. Valid files enter a clear queue, where upload progress, success, errors, removal, and retry remain visible.

Promise picker

Call SUpload.pick(options) without rendering an Upload component. It opens the native file picker and resolves with File or File[]; cancelling resolves undefined. Validation failures reject with UploadPickError, whose reason is type, size, limit, guard, or unsupported.

This API selects files only. Continue with your own request after the Promise resolves, or use the component when users need a visible queue, progress, removal, and retry flow.

Image queue

Set mode="image" for image-only selection. list-type="card" and preview-fit control the visual queue without changing upload behavior.

Automatic upload

Use automatic to start each accepted file immediately. A custom request reports progress through updateProgress; failed items keep an explicit retry action.

Custom trigger

The trigger slot receives choose, dragging, and disabled, so branded entry points can reuse the same picker, validation, and drop behavior.

Shape

Use shape="square" to align the upload surface, queue, previews, and actions with the global square geometry.

API

PROPS

Property
Type
Values
Description
default
Example
More
model-value
File | File[] | null
selected files
Controls the selected file collection through v-model.
—
shape
String
rounded | square
Applies rounded or square geometry to the upload surface and file queue.
rounded
drag
Boolean
true | false
Accepts files dropped on the upload surface.
true
list-type
String
auto | list | card
Chooses a compact row queue or visual card queue; auto uses cards in image mode.
auto
preview-fit
String
cover | contain
Controls how image previews fit their card.
cover
mode
String
all | image
Restricts selection to images and selects the automatic queue presentation.
all
multiple
Boolean
true | false
Allows selecting and dropping more than one file.
false
single-upload
Boolean
true | false
Replaces the current queue with each new valid selection.
false
accept
String
MIME type | extension list
Filters file types for both the native picker and dropped files.
—
file-types
String[]
MIME type | extension list
Provides accepted file rules when accept is not set.
[]
limit
Number | String
positive number
Limits the number of files kept in the queue.
—
limit-count
Number | String
positive number
Compatibility alias of limit.
—
limit-size
Number | String
megabytes
Rejects individual files larger than the configured size.
—
automatic
Boolean
true | false
Starts uploading immediately after files pass validation.
false
auto-submit
Boolean
true | false
Compatibility alias of automatic.
false
action
String
URL
POST endpoint used by the built-in XMLHttpRequest adapter.
—
upload-method
Function
({ fileoptionupdateProgress }) => Promise
Replaces the built-in request and can report progress through updateProgress.
—
file-name
String
form field name
Names the file field in the built-in multipart request.
file
headers
Object
Record<stringstring>
Adds headers to the built-in upload request.
—
data
Object
Record<stringstring>
Adds fields to the built-in multipart request.
—
before-select-method
Function
({ file }) => boolean | Promise<boolean>
Applies application validation before a file enters the queue.
—
before-remove-method
Function
({ option }) => boolean | Promise<boolean>
Guards removal of a queued file.
—
text
String
text
Sets the upload surface title.
Upload File
text-max
String
text
Replaces the title shown after the file limit is reached.
—
button-text
String
text
Compatibility title that takes precedence over text.
—
show-tip
Boolean
true | false
Shows the supporting tip below the component.
false
tip-text
String
text
Sets the built-in supporting tip.
—
show-list
Boolean
true | false
Shows the selected file queue.
true
show-preview
Boolean
true | false
Shows generated previews for image files.
true
show-progress
Boolean
true | false
Shows per-file and aggregate upload progress.
true
show-retry
Boolean
true | false
Shows a retry action for failed uploads.
true
show-remove-button
Boolean
true | false
Shows the remove action on queue items.
true
show-upload-button
Boolean
true | false
Shows the manual queue upload action.
true
show-submit-button
Boolean
true | false
Shows the manual queue upload action.
true
show-button-icon
Boolean
true | false
Shows the icon in the manual upload action.
true
show-button-text
Boolean
true | false
Shows the label in the manual upload action.
true
readonly
Boolean
true | false
Displays files without selection, removal, retry, or upload controls.
false
disabled
Boolean
true | false
Disables file picking and dropping.
false

Promise file picker

Method
Type
Description
default
Example
More
SUpload.pick
Selects files without mounting UI; multiple or directory returns File[], cancellation resolves undefined, and validation rejects with UploadPickError.
—
pickUploadFiles
Named export with the same implementation and return contract as SUpload.pick.
—

EVENTS

Event
Type
Description
default
Example
More
update:modelValue
—
Emits the controlled file value after add, remove, or clear.
—
—
change
—
Emits after a picker or drop interaction is processed.
—
—
add
—
Emits for every file added to the queue.
—
—
remove
—
Emits after a file is removed from the queue.
—
—
reject
—
Emits when type, size, limit, or application validation rejects a file.
—
—
exceed
—
Emits when a selection exceeds the configured file count.
—
—
progress
—
Emits normalized upload progress from 0 through 100.
—
—
retry
—
Emits before retrying one failed item.
—
—
upload-start
—
Emits when one file starts uploading.
—
—
upload-success
—
Emits when one file uploads successfully.
—
—
upload-error
—
Emits when one file upload fails.
—
—
upload-end
—
Emits when one file upload settles.
—
—
upload-queue-start
—
Emits before a manual or automatic batch begins.
—
—
upload-queue-end
—
Emits after every item in the batch settles.
—
—
on-delete
—
Compatibility event emitted after file removal.
—
—
on-success
—
Compatibility event emitted after upload success.
—
—
on-error
—
Compatibility event emitted after validation or upload failure.
—
—

SLOTS

Slot
Scope
Description
default
Example
More
trigger
{ choose: () => void; dragging: boolean; disabled: boolean }
Replaces the dropzone content. Receives choose, dragging, and disabled.
—
—
tip
—
Replaces the supporting tip below the upload flow.
—
—

EXPOSES

Method
Type
Description
default
Example
More
choose
—
Opens the native file picker.
—
—
submit
—
Uploads every ready or failed queue item.
—
—
clear
—
Clears the file queue and synchronizes v-model.
—
—
remove
—
Removes a queue item by index or item reference.
—
—
retry
—
Retries one failed queue item.
—
—
getPendingFiles
—
Returns raw files that have not uploaded successfully.
—
—
Last Updated: 2026-10-28, 06:17:56 UTC
Copied