@reactloom/files
v1.3.0
Published
Accessible React file components for ReactLoom: drop zone and uploader with progress, cancel and retry, a file explorer and a file preview, with a pluggable upload adapter.
Maintainers
Readme
@reactloom/files
Accessible file upload for ReactLoom: FileDropZone, FileUploader, FileList and the
useFileUpload hook.
pnpm add @reactloom/files @reactloom/ui @reactloom/themeimport '@reactloom/files/styles.css';
import { FileUploader, type UploadAdapter } from '@reactloom/files';
const upload: UploadAdapter = (file, { signal, onProgress }) => myApi.upload(file, { signal, onProgress });
<FileUploader label="Attachments" upload={upload} accept="image/*,.pdf" maxSize={10 * 1024 * 1024} />;- Bring your own transport: the adapter receives an
AbortSignal(cancel) and anonProgress(fraction)callback. The package handles the queue, concurrency, retries and status. - Keyboard and screen-reader first: a real file input behind a “Browse files” button — drag and drop is an enhancement — and status changes are announced.
Documentation and live examples: https://www.reactloom.dev/components/file-uploader · https://www.reactloom.dev/components/file-explorer
