Skip to content

File upload โ€‹

A drag-and-drop file uploader with previews, validation states and a built-in file list. Toggle Vue / CSS to switch the live demo and source together.

Basic โ€‹

Single-file upload with default styling.

Vue SFC

Compact โ€‹

Reduced padding via variant="compact".

Vue SFC

Icon โ€‹

Replace the default ๐Ÿ“Ž with an iconify class via the icon prop (e.g. icon="i-mdi-cloud-upload"), or pass a slot="icon" child โ€” the slot wins over the prop. Use remove-icon for the file list's remove button.

Vue SFC

Multiple โ€‹

Allow multiple files with optional max-files / max-file-size.

Vue SFC

Image โ€‹

Image-only upload with previews.

Vue SFC

Validation โ€‹

Valid, invalid and warning states with messages.

Vue SFC

States โ€‹

Disabled and required examples.

Vue SFC

Preloaded โ€‹

Initialize the uploader with existing files.

Vue SFC

Event log โ€‹

Live log of mno-change, mno-remove and mno-error events.

Vue SFC

Customized โ€‹

Override per-element styling with the cssClass prop (Vue) or extra utility classes (CSS).

Vue SFC

CSS Variables โ€‹

Vue SFC

Every uploader is themed through --mono-file-upload-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ€” custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-file-upload> and the shadow build. To re-skin globally, set the underlying --theme-* tokens.

VariableDefaultControls
--mono-file-upload-primary--theme-primaryAccent (default icon, dropzone hover/drag)
--mono-file-upload-text--theme-textFile name / body text color
--mono-file-upload-background--theme-backgroundDropzone / thumbnail background
--mono-file-upload-surface--theme-surfaceFile-item background
--mono-file-upload-border--theme-borderDropzone / file-item border color
--mono-file-upload-success--theme-successValid-state color
--mono-file-upload-danger--theme-dangerInvalid / remove-hover color
--mono-file-upload-warning--theme-warningWarning-state color

Types โ€‹

Importimport { FileUploadProps } from 'mono-helper'
PropValueDefaultDescription
labelstringโ€”Field label shown above the dropzone.
helperTextstringโ€”Helper text shown below the dropzone.
placeholderstringโ€”Primary prompt text inside the dropzone.
subtextstringโ€”Secondary hint text inside the dropzone.
acceptstringโ€”Accepted file types for the file input.
iconstringโ€”Dropzone icon. An iconify utility class (e.g. `i-mdi-cloud-upload`) renders the icon; any other string renders as text/emoji. A `slot="icon"` child takes priority over this prop.
removeIconstringโ€”Remove (โœ•) button icon โ€” iconify class or text.
multiplebooleanโ€”Allows selecting multiple files at once.
disabledbooleanโ€”Disables interaction and dims the component.
requiredbooleanโ€”Marks the field as required with an indicator.
dragdropbooleanโ€”Enables drag-and-drop file selection.
maxFileSizenumberโ€”Maximum allowed size per file, in bytes.
maxFilesnumberโ€”Maximum number of files allowed.
modelValueFileUploadItem[]โ€”Two-way bound list of selected files.
variant'default' | 'compact'โ€”Layout style: default or compact.
validationState'warning' | 'default' | 'valid' | 'invalid'โ€”Validation state styling the component.
validationMessagestringโ€”Validation message shown below the dropzone.
cssClassFileUploadCssClassโ€”Per-element class overrides for internal parts.
visiblebooleanโ€”Whether the control is shown. Defaults to `true`.
visibleType'invisible' | 'none'โ€”How it hides when `visible` is `false`. Defaults to `'none'`.