UI Setup
Install shadcn-compatible upload, download, and delete UI components.
@dimah-s3/ui provides accessible, theme-ready UI controls built on top of shadcn design tokens and @dimah-s3/react hooks.
Installation
@dimah-s3/core, @dimah-s3/react, and @fuma-translate/react are peer
dependencies. Install them with the package:
npm i @dimah-s3/ui@beta @dimah-s3/core@beta @dimah-s3/react@beta @fuma-translate/react shadcnImport CSS stylesheet
Import the UI stylesheet in your global CSS to enable animations and design tokens:
@import "shadcn/tailwind.css";
@import "@dimah-s3/ui/styles.css";
/* shadcn theme variables (`--primary`, `--muted`, …) */Mount Toaster
Mount one <Toaster /> next to <S3Provider> in your root layout:
import { Toaster } from "@dimah-s3/ui";
import { S3Provider } from "@/lib/s3-client";
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>
<S3Provider>{children}</S3Provider>
<Toaster />
</body>
</html>
);
}Render a component
Each family has a root that holds one hook, and parts that read it. Toasts
are separate: mount UploadToasts, DownloadToasts, or DeleteToasts once
per hook.
"use client";
import { useUpload } from "@dimah-s3/react";
import {
Upload,
UploadToasts,
UploadTrigger,
UploadStatus,
} from "@dimah-s3/ui";
export function AvatarUploader() {
const upload = useUpload({ route: "avatar" });
return (
<>
<Upload upload={upload}>
<UploadTrigger />
<UploadStatus />
</Upload>
<UploadToasts upload={upload} />
</>
);
}Components never toast on their own. A second toast owner for the same hook renders nothing and warns in development.
Explore UI components
Upload
Upload
File picker, dropzone with the progress inside, queue status, and toasts for useUpload.
Upload Field
Form field whose value is the uploaded object keys.
Avatar Upload
Image button that shows and replaces a picture, round or square.
Download and delete
Download
Download triggers and fetch progress for one download hook.
Delete
Delete triggers with one confirm dialog per root.
Files
Object List
Composable file browser for useObjectList: list and grid views, search, sort, selection, and folders.
Object Card
One stored file with download and delete actions.
Object Image
Image of a private object with a signed, refreshed URL.
Attachment
File cards, status rows, progress rings, and type glyphs.
Customization
Frequently asked questions
Yes. Add items from the shadcn registry to copy their source into your
codebase. The items are upload, upload-field, avatar-upload,
object-image, object-card, download, delete, object-list, and
file-attachment:
npx shadcn@latest add @dimah-s3/upload @dimah-s3/deleteThe components read their strings through @fuma-translate/react. See
Internationalization.