File Upload

Mobile-first file upload with MIME-type and size validation, multi-file selection, error states, and read-only file cards.

import { FileUpload, FileCard, FileCardGroup } from "@plexui/vue/components/FileUpload";

Examples

Overview

  • government-id-scan.pdf
    2.1 MB
  • passport-photo.png
    340 KB
  • non-citizen-travel-2026-approved-document.pdf
    1.5 MB

File Card

Standalone file card component. Wrap with FileCardGroup for the bordered container. Leave out the @remove listener (onRemove) to hide the delete button.

File list

government-id-scan.pdf
2.1 MB
passport-photo.png
340 KB
non-citizen-travel-2026-approved-document.pdf
1.5 MB

API

PropTypeDefaultDescription
variant"compact" | "area""compact"Visual variant: compact button or larger tappable area
labelstring—Button label text
descriptionstring—Helper text below the icon (area variant only)
acceptstring—Accepted file types (e.g. ".pdf,.png,image/*")
multiplebooleanfalseAllow selecting multiple files. Without it, a new pick replaces the current file
max-filesnumber—Maximum number of files. In multiple mode, the button disables at the limit. Single-file mode keeps the button available for replacement.
max-sizenumber—Maximum file size in bytes
value / v-model:valueFile[]—Controlled file list; `update:value` fires when files are added or removed
@file-reject(file: File, reason: string) => void—Fires when a file is rejected (wrong type, too large, over limit)
error-messagestring—Error message; sets the invalid visual state
invalidbooleanfalseInvalid state (auto-set when error-message is provided)
disabledbooleanfalseDisable all interactions
idstring—Id of the hidden file input
classstring—Additional CSS class

Files are picked with the button (or the area); dropping files on it is not supported.

FileCard

PropTypeDefaultDescription
fileFile—The file to display
@remove() => void—Remove callback. When omitted, the delete button is hidden.
disabledbooleanfalseDisable the remove button
classstring—Additional CSS class

FileCardGroup

PropTypeDefaultDescription
default slotVNode[]—FileCard elements
classstring—Additional CSS class

Styling

File Upload reads these component tokens. Override them at any scope to restyle it:

  • --field-error-margin-top: error margin top (default 0.5rem)
  • --file-upload-area-border-radius: area border radius (default var(--radius-xl))
  • --file-upload-area-min-height: area min height (default 10rem)
  • --file-upload-gutter: gutter (default var(--floating-input-gutter))
  • --file-upload-list-gap: list gap (default 0.5rem)
  • --floating-input-background: background (default var(--color-surface))
  • --floating-input-border-color: border color
  • --floating-input-border-color-hover: border color hover
  • --floating-input-border-color-invalid: border color invalid (default var(--color-border-danger-outline))
  • --floating-input-transition-duration: transition duration (default 80ms)
  • --input-text-color: text color (default var(--color-text))