Components
Upload Button
File picker button for single- or multi-file uploads with inline status and toast support.
UploadButton connects directly to a useUpload hook and triggers the native OS file picker.
Preview
Install
Complete UI Setup first — stylesheet and toaster. Then add this component:
import { UploadButton } from "@dimah-s3/ui";Usage
"use client";
import { useUpload } from "@dimah-s3/react";
import { UploadButton } from "@dimah-s3/ui";
export function FileUploader() {
const upload = useUpload({
route: "avatar",
});
return <UploadButton upload={upload} />;
}Props
import type { UploadButtonProps } from "@dimah-s3/ui";Frequently asked questions
Use the dismiss control on a completed or failed attachment, or call
upload.reset() yourself. Both clear the status row.
Pass status={false}:
<UploadButton upload={upload} status={false} /> Pass toast={true} and mount <Toaster /> near your app root:
<UploadButton upload={upload} toast={true} />