File Upload

Drag-and-drop file uploader with preview, progress, and validation hooks.

Forms & Inputs@sisyphos-ui/file-uploadView on npmView as Markdown

Preview

tsx

Drag & drop a file here, or

Supported formats: PNG, JPG, WEBPMax size: 10.0 MB

Installation

Install the individual package:

$ pnpm add @sisyphos-ui/file-upload @sisyphos-ui/core

Or use the umbrella package that bundles everything:

$ pnpm add @sisyphos-ui/ui

Usage

Import the component styles and the component itself:

snippet.tsxtsx
import "@sisyphos-ui/file-upload/styles.css";
import { FileUpload } from "@sisyphos-ui/file-upload";

Max size with onReject

`maxSize` enforces a byte limit; `onReject` receives the rejection reason so you can show a friendly message.

tsx

Drag & drop a file here, or

Max size: 2.0 MB

Error state

Pair `error` with external error messaging for form validation.

tsx

Drag & drop a file here, or

Max size: 10.0 MB

Please attach your CV to continue.

API

Props table is being written. See the package README for the complete API surface.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README.

Was this page helpful?
Edit this page on GitHub