File Upload

Mobile-first file picker with type validation and multi-file support

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

Examples

Overview

With files

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

Error state

  • government-id-scan.pdf
    2.1 MB

Disabled

File Card

Standalone file card component. Wrap with FileCardGroup for the bordered container. Omit onRemove to hide the delete button.

Read-only

project-brief.pdf
2.3 MB

With remove

project-brief.pdf
2.3 MB

Multiple files

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

Read-only list

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

Reference

PropTypeDefaultDescription
variant"compact" | "area""compact"Visual variant — compact button or larger tappable area
labelstringButton label text
descriptionstringHelper text below the icon (area variant only)
acceptstringAccepted file types (e.g. ".pdf,.png,image/*")
multiplebooleanfalseAllow selecting multiple files
maxFilesnumberMaximum number of files. Button disables at limit.
maxSizenumberMaximum file size in bytes
valueFile[]Controlled file list
onValueChange(files: File[]) => voidCallback when files are added or removed
onFileReject(file: File, reason: string) => voidCallback when a file is rejected (wrong type, too large, over limit)
errorMessagestringError message — sets invalid visual state
invalidbooleanfalseInvalid state (auto-set when errorMessage is provided)
disabledbooleanfalseDisable all interactions

FileCard

PropTypeDefaultDescription
fileFileThe file to display
onRemove() => voidRemove callback. When omitted, the delete button is hidden.
disabledbooleanfalseDisable the remove button
classNamestringAdditional CSS class

FileCardGroup

PropTypeDefaultDescription
childrenReactNodeFileCard elements
classNamestringAdditional CSS class