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 AvatarUploader() {
const upload = useUpload({
route: "avatar",
});
return <UploadButton upload={upload} label="Choose Avatar" />;
}Props
import type { UploadButtonProps } from "@dimah-s3/ui";Frequently asked questions
Completed and failed attachments include a dismiss control that calls upload.reset(). You can also call reset() yourself.
Pass status={false}:
<UploadButton upload={upload} status={false} />Pass toast={true} (make sure <Toaster /> is mounted near your app root):
<UploadButton upload={upload} toast={true} />