MeldUI

File Upload

A file upload component with drag and drop, previews, and progress tracking.

Usage

Props

PropTypeDefaultDescription
modelValueFile[]-The list of selected files. Use with v-model.
acceptstring-Accepted MIME types or file extensions.
maxFilesnumberInfinityMaximum number of files allowed.
maxSizenumber-Maximum file size in bytes.
multiplebooleantrueWhether multiple files can be selected.
disabledbooleanfalseWhether the upload is disabled.

Events

EventPayloadDescription
update:modelValueFile[]Emitted when files change.
file-acceptFileEmitted when a file passes validation.
file-reject{ file: File, errors: FileError[] }Emitted when a file fails validation.

Sub-components

FileUploadDropzone

Drag and drop target area.

Slots

SlotPropsDescription
default{ isDragging: boolean, isDisabled: boolean, openFilePicker: () => void }Content with drag state access.

FileUploadTrigger

Button that opens the file picker dialog.

FileUploadList

Container for uploaded file items.

FileUploadItem

Individual file display with status.

PropTypeDefaultDescription
file*File-The file object.
progressnumber-Upload progress percentage (0-100).
status'pending' | 'uploading' | 'complete' | 'error''pending'Upload status.
errorstring-Error message for failed uploads.

FileUploadItemName

Displays the file name.

FileUploadItemSize

Displays the file size.

PropTypeDefaultDescription
precisionnumber1Decimal places for size display.

FileUploadItemPreview

Image preview thumbnail.

FileUploadItemProgress

Upload progress bar.

PropTypeDefaultDescription
variant'default' | 'success' | 'destructive''default'Progress bar color variant.

FileUploadItemDelete

Button to remove the file.

FileUploadClear

Button to clear all files.