Skip to content

File Uploader (Dropzone)

Form

Drag-and-drop file upload area built with react-dropzone. Supports file type and size validation.

PNG and JPEG selectionFile list and removalSize and count limits
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Compose FileUploadList inside FileUpload. accept, maxSize, and maxFiles configure local file selection. This component does not send files to a server or expose a rejection callback.

Import
import {
  FileUpload,
  FileUploadList,
} from "@dashboardpack/core/components/ui/file-upload";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

File Uploader (Dropzone) props
PropType / DefaultDescription
value / onValueChangeFile[] / (files: File[]) => void

Default: internal state

Optional controlled selected files.
acceptDropzoneOptions["accept"]

Default: —

MIME types mapped to extensions.
maxSizenumber

Default: —

Maximum bytes per file.
maxFilesnumber

Default: —

Maximum selected files.
disabledboolean

Default: false

Disable file selection.
childrenReactNode

Default: required

Place FileUploadList or custom content here.

Build with these too