BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/utilcn/upload-file

Upload A File To Storage

utilcn/upload-file
FreeComponent

Upload a file to a storage provider using a presigned upload URL.

Install it

npx shadcn@latest add https://utilcn.dev/r/upload-file.json

Source

registry/default/storage/upload-file.tsxutilcn.dev/r/upload-file.json
1'use client';
2
3import { type ChangeEvent, useState } from 'react';
4import { useUploadFile } from '@/registry/default/storage/use-upload-file';
5
6export function UploadFile() {
7 const [progress, setProgress] = useState(0);
8 const [isUploading, setIsUploading] = useState(false);
9 const { uploadFile } = useUploadFile();
10
11 const handleFileChange = (e: ChangeEvent<HTMLInputElement>) => {
12 const file = e.target.files?.[0];
13 if (!file) {
14 return;
15 }
16
17 setIsUploading(true);
18 uploadFile({
19 file,
20 onProgress: (p: number) => setProgress(p),
21 onSuccess: (url: string) => {
22 console.log('Uploaded to:', url);
23 setIsUploading(false);
24 setProgress(0);
25 },
26 onError: (err: Error) => {
27 console.error(`Upload failed: ${err.message}`);
28 setIsUploading(false);
29 setProgress(0);
30 },
31 });
32 };
33
34 return (
35 <div className="flex flex-col gap-4">
36 <input
37 className="file:mr-4 file:rounded-md file:border-0 file:bg-secondary file:px-4 file:py-2 file:font-semibold file:text-secondary-foreground file:text-sm hover:file:bg-secondary/80"
38 onChange={handleFileChange}
39 type="file"
40 />
41
42 {isUploading && (
43 <div className="mt-4 flex items-center gap-2">
44 <div className="h-2 w-full rounded-full bg-secondary">
45 <div
46 className="h-2 rounded-full bg-primary transition-all duration-300"
47 style={{ width: `${progress}%` }}
48 />
49 </div>
50 <span className="text-muted-foreground text-sm">{progress}%</span>
51 </div>
52 )}
53 </div>
54 );
55}

What it pulls in

npm packages

  • @tanstack/react-query

Files it writes

  • registry/default/storage/upload-file.tsx
  • registry/default/storage/use-upload-file.ts

Facts

Registry
utilcn
Type
registry:component
Access
Free
Files written
2
Licence
the repository states none
In the index
at or before 2026-08-08
Last confirmed
today

Go to the source

utilcn.dev BrennenRocks/utilcn on GitHub Raw registry item This item as JSON

More from utilcn

All 17 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Download A File From Storagedownload-fileutilcnComponentsFree2 deps · 2 files
Upload Multiple Filesupload-multiple-filesutilcnComponentsFreeno deps · 2 files

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex