Skip to Content
dimah-s3v2.8.1

Overview

Accessible shadcn components for uploading, downloading, deleting, and browsing files stored in S3.

@dimah-s3/ui is a set of accessible React components for file uploads and stored files. They render the @dimah-s3/react hooks, follow your shadcn theme, and install as an npm package or as source code you own through the shadcn registry.

Drag and drop files here

You can upload 4 files. Each up to 75.0 MB.

Components

Upload

Files

Actions and building blocks

How the components work

You create the hook; the component renders it. The upload, download, and delete components are families: a root takes one hook return, and the parts inside it read that hook.

"use client";

import { useUpload } from "@dimah-s3/react";
import {
  Upload,
  UploadStatus,
  UploadToasts,
  UploadTrigger,
} from "@dimah-s3/ui";

export function AvatarUploader() {
  const upload = useUpload({ route: "avatar" }); // you own the hook

  return (
    <>
      <Upload upload={upload}>
        <UploadTrigger /> {/* opens the file picker */}
        <UploadStatus /> {/* shows progress and errors */}
      </Upload>
      <UploadToasts upload={upload} /> {/* toasts for this hook */}
    </>
  );
}
  • Your hook, your rules. Route, limits, and callbacks live in the hook options. Components never call a hook themselves.
  • Roots render no element. Place the parts anywhere inside the root, in your own layout. Several parts can share one hook.
  • Toasts are opt-in. Parts never toast. Mount UploadToasts, DownloadToasts, or DeleteToasts once per hook, and one <Toaster /> in your layout.
  • Parts are elements. Each part forwards the props of the element it renders: triggers take every Button prop, lists take ul props, and so on.
FamilyRootHookParts
UploadUploaduseUploadUploadTrigger, UploadDropzone, UploadStatus, UploadFileList
DownloadDownloaduseDownload, useFetchDownloadDownloadTrigger, DownloadProgress
DeleteDeleteuseDeleteDeleteTrigger, DeleteConfirmDialog

UploadField, AvatarUpload, ObjectCard, and ObjectList build on these families, so the same hooks drive them.

npm package or shadcn registry

npm packageshadcn registry
You get@dimah-s3/ui in node_modulesThe component source in components/dimah-s3/
UpdatesBump the package versionRun shadcn add again and merge
PrimitivesBundled, so any shadcn style worksYour own button, tooltip, … in a Base UI style
CustomizeProps, className, theme tokensEdit the code

Start with the npm package. Switch an item to the registry when you need to change its markup. See Installation.

Built in

  • Accessible. Built on Base UI primitives, with keyboard support, focus management, and live regions that announce progress and results.
  • Translatable. Every string goes through @fuma-translate/react, and layouts work right to left. See Internationalization.
  • Themeable. Colors follow your shadcn variables, and --dimah-s3-* tokens override them for the components alone. See Theming.
  • Headless underneath. Need a different design? Build on the same hooks. See Custom UI.

On this page