File Upload
Drag-and-drop file uploader with preview, progress, and validation hooks.
Preview
example.tsxtsx
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/coreOr use the umbrella package that bundles everything:
$ pnpm add @sisyphos-ui/uiUsage
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.
example.tsxtsx
Drag & drop a file here, or
Max size: 2.0 MB
Error state
Pair `error` with external error messaging for form validation.
example.tsxtsx
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