Skip to content
aq-ui
Back to ComponentsComponent

File Upload

Keyboard-accessible drop zone with validation, progress, retry, cancellation, and transport-neutral uploads.

Preview

This is a live example. Interact with the available controls and use the keyboard to inspect the component's states and behavior.

Loading interactive preview…

Installation

pnpm dlx aq-ui@alpha add file-upload

API reference

Client module

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

"use client"

import { FileUpload } from "@/components/ui/file-upload"

<FileUpload />

FileUpload

constSource L50

Keyboard-accessible drop zone with validation, progress, retry, cancellation, and transport-neutral uploads.

const FileUpload = React.forwardRef<React.ComponentRef<"div">, FileUploadProps>(…)
Props type
FileUploadProps
<FileUpload />

FileUploadEntry

typeSource L27

Type contract for FileUploadEntry.

type FileUploadEntry = ControllerFileUploadEntry

FileUploadProps

interfaceSource L29

Type contract for FileUploadProps.

interface FileUploadProps extends Omit< React.ComponentProps<"div">, "defaultValue" | "onChange" >

Members

NameTypeDefault
value?File[]—
defaultValue?File[][]
onValueChange?(files: File[]) => void—
onUploadComplete?(assets: UploadedAsset[]) => void—
uploadAdapter?EditorAssetUploadAdapter—
autoUpload?booleantrue
accept?string—
multiple?booleantrue
maxFiles?numberNumber.POSITIVE_INFINITY
maxSize?numberNumber.POSITIVE_INFINITY
disabled?boolean—
onReject?(rejections: FileUploadRejection[]) => void—
name?string—
label?React.ReactNode"Drop files here or choose files"
description?React.ReactNode—

UploadStatus

typeSource L26

Type contract for UploadStatus.

type UploadStatus = FileUploadStatus

Registry dependencies

button, progress, upload, use-file-upload, utils

Package dependencies

lucide-react@^1.31.0

Files

  • components/ui/file-upload.tsx

Source