FileUpload

Drag-and-drop dropzone with click-to-browse fallback. Validates count + size + accept, shows a per-file row with size and remove button. Controlled or uncontrolled, no runtime dependency.

Drag files here
or Click to browse
Images up to 2 MB · up to 5 files

Usage

import { FileUpload } from '@bwo-ui/react';

const [files, setFiles] = useState<File[]>([]);

<FileUpload
  value={files}
  onValueChange={setFiles}
  multiple
  maxFiles={5}
  maxSize={2 * 1024 * 1024}
  accept="image/*"
  hint="Images up to 2 MB · up to 5 files"
/>

Props

PropTypeDefaultDescription
valueFile[]Controlled file list.
defaultValueFile[][]Uncontrolled default.
onValueChange(files: File[]) => voidFires when files are added or removed.
multiplebooleanfalseAllow multiple files.
acceptstringMIME types or extensions, comma-separated.
maxFilesnumberMaximum number of files.
maxSizenumberMaximum size per file in bytes.
hintReactNodeHint text under the dropzone.
headingReactNodeOverride the heading text.
ctaReactNode'Click to browse'Override the click-to-browse copy.