Primitives

File upload

card, dropzone, gallery, avatar, button, compact. Rejected files are listed with the reason; images get a thumbnail; progress and retry.

card · the border turns while a file is over it

Drag and drop files

or · up to 5.0 MB each

IMAGEPDFCSV

dropzone · the default

gallery · site photos, progress on the tiles, up to 7

avatar · one round image

Site logo

Square, PNG or JPG, up to 2 MB

button

PDF

compact · one row in a form

Rates sheet (.csv or .xlsx)

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import { FileUpload } from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<FileUpload>

src/components/ui/file-upload.tsx
PropTypeDefaultDescription
valueFile[]—
defaultValueFile[][]
onValueChange(files: File[]) => void—
acceptstring—As on <input type="file">: "image/*", ".csv,.xlsx".
multipleboolean—
maxSizenumber—Bytes.
maxFilesnumber—
variant"dropzone" | "card" | "compact" | "button" | "gallery" | "avatar""dropzone"
titleReact.ReactNode—
hintReact.ReactNode—
progressRecord<string, number>—Upload progress by file name, 0–100.
failedstring[]—Names of files whose upload failed; they get a retry button.
onRetry(file: File) => void—
currentUrlstring—avatar: the current image (a URL) before a new one is picked.
disabledboolean—
classNamestring—

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui