This component no longer exists. It was in diceui/base’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-13 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
file-upload-uploadthing-demo
diceui-base/file-upload-uploadthing-demoRemovedExample
diceui/base publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/base-vega/file-upload-uploadthing-demo.jsonSource
1"use client";23import { Upload, X } from "lucide-react";4import * as React from "react";5import { toast } from "sonner";6import { UploadThingError } from "uploadthing/server";7import { uploadFiles } from "@/lib/uploadthing";8import { Button } from "@/registry/bases/base/ui/button";9import {10 FileUpload,11 FileUploadDropzone,12 FileUploadItem,13 FileUploadItemDelete,14 FileUploadItemMetadata,15 FileUploadItemPreview,16 FileUploadItemProgress,17 FileUploadList,18 type FileUploadProps,19 FileUploadTrigger,20} from "@/registry/bases/base/ui/file-upload";2122export default function FileUploadUploadThingDemo() {23 const [isUploading, setIsUploading] = React.useState(false);24 const [files, setFiles] = React.useState<File[]>([]);2526 const onUpload: NonNullable<FileUploadProps["onUpload"]> = React.useCallback(27 async (files, { onProgress }) => {28 try {29 setIsUploading(true);30 const res = await uploadFiles("imageUploader", {31 files,32 onUploadProgress: ({ file, progress }) => {33 onProgress(file, progress);34 },35 });3637 toast.success("Uploaded files:", {38 description: (39 <pre className="mt-2 w-80 rounded-md bg-accent/30 p-4 text-accent-foreground">40 <code>41 {JSON.stringify(42 res.map((file) =>43 file.name.length > 2544 ? `${file.name.slice(0, 25)}...`45 : file.name,46 ),47 null,48 2,49 )}50 </code>51 </pre>52 ),53 });54 } catch (error) {55 setIsUploading(false);5657 if (error instanceof UploadThingError) {58 const errorMessage =59 error.data && "error" in error.data60 ? error.data.error61 : "Upload failed";62 toast.error(errorMessage);63 return;64 }6566 toast.error(67 error instanceof Error ? error.message : "An unknown error occurred",68 );69 } finally {70 setIsUploading(false);71 }72 },73 [],74 );7576 const onFileReject = React.useCallback((file: File, message: string) => {77 toast(message, {78 description: `"${file.name.length > 20 ? `${file.name.slice(0, 20)}...` : file.name}" has been rejected`,79 });80 }, []);8182 return (83 <FileUpload84 accept="image/*"85 maxFiles={2}86 maxSize={4 * 1024 * 1024}87 className="w-full max-w-md"88// … truncated
What it pulls in
npm packages
Other registry items
