2.0 beta — new releases can include breaking changes. Stable 1.x docs
dimah-s3v2.0.0-beta.0

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 shadcn

Import CSS stylesheet

Import the UI stylesheet in your global CSS to enable animations and design tokens:

app/globals.css
@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:

app/layout.tsx
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.

components/avatar-uploader.tsx
"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

Download and delete

Files

Customization

Frequently asked questions

On this page