React Client
Headless React client for S3 upload, download, and delete flows.
@dimah-s3/react is the
headless React client for dimah-s3. It manages file intake, validation,
progress, retries, cancellation, and multipart transfers while leaving the UI
to you.
Uploads and, by default, downloads run directly between the browser and the bucket; credentials remain on the server. Downloads can also use the server's same-origin proxy mode.
Key features
- Headless architecture — Transfer state and accessible DOM props without imposed markup or styles.
- Presigned transfers — Uploads and default-mode downloads bypass your application server.
- Multipart support — Automatic chunking for large files with resumable state via
UploadStore. - Automatic constraint sync — Loads file-size and MIME-type constraints from server route definitions.
- Ready-made UI — Optional accessible shadcn components for common file controls.
- Backend agnostic — Use
@dimah-s3/serveror a complete customS3Apiimplementation.
Documentation
React Setup
Initialize createS3Client, configure S3Provider, and call your first hook.
Upload
useUpload — single and multi-file uploads with progress tracking.
Download
useDownload — direct downloads and progress streams.
Delete
useDelete — confirm and remove objects through your API.
UI Setup
Ready-made shadcn buttons and dropzones built on these hooks.
Upload Store
Persist multipart metadata and resume after the same local file is reselected.
Helpers
Pure utilities for progress formatting, file sizing, and validation.
Forms
Add file uploads to React Hook Form or TanStack Form.
TanStack Query
Invalidate cached records after a confirmed upload.
Bring Your Own Backend
Implement the complete S3Api contract for an existing backend.