Customization
Custom UI
Build bespoke upload interfaces using headless hooks and custom components.
Combine @dimah-s3/react hooks with your own components or custom shadcn primitives.
Preview
Example: Headless File Uploader
"use client";
import { useUpload } from "@dimah-s3/react";
import { Button } from "@/components/ui/button";
export function CustomFilePicker() {
const upload = useUpload({
route: "avatar",
noDrag: true,
noClick: true,
});
return (
<div className="flex items-center gap-4">
<input {...upload.getInputProps()} />
<Button type="button" onClick={() => upload.open()}>
{" "}
{upload.isUploading
? `Uploading ${upload.progress.percent}%`
: "Choose file"}
</Button>
</div>
);
}Frequently asked questions
Read upload.progress for loaded bytes, total bytes, percentage, and transfer
speed:
const { progress } = useUpload({ route: "avatar" });
console.log(progress.loaded, progress.total, progress.percent);