BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/utilcn/download-file

Download A File From Storage

utilcn/download-file
FreeComponent

Download a file from a storage provider using a presigned download URL.

Install it

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

Source

registry/default/storage/download-file.tsxutilcn.dev/r/download-file.json
1'use client';
2
3import { Download } from 'lucide-react';
4import type { PropsWithChildren } from 'react';
5import { cn } from '@/lib/utils';
6import { useDownloadFile } from '@/registry/default/storage/use-download-file';
7
8type DownloadFileProps = PropsWithChildren<{
9 fileKey: string;
10 fileName?: string;
11 className?: string;
12}>;
13
14export function DownloadFile({
15 fileKey,
16 fileName,
17 children,
18 className,
19}: DownloadFileProps) {
20 const downloadFile = useDownloadFile();
21
22 const handleDownload = () => {
23 downloadFile.mutate(
24 { fileKey, fileName },
25 {
26 onSuccess: (url: string) => {
27 console.log('Download initiated:', url);
28 },
29 onError: (err: Error) => {
30 console.error(`Download failed: ${(err as Error).message}`);
31 },
32 },
33 );
34 };
35
36 return (
37 <button
38 className={cn('flex items-center gap-2', className)}
39 disabled={downloadFile.isPending}
40 onClick={handleDownload}
41 type="button"
42 >
43 {children || (
44 <>
45 <Download className="mr-2 h-4 w-4" />
46 {downloadFile.isPending ? 'Downloading...' : 'Download'}
47 </>
48 )}
49 </button>
50 );
51}

What it pulls in

npm packages

  • @tanstack/react-query
  • lucide-react

Files it writes

  • registry/default/storage/download-file.tsx
  • registry/default/storage/use-download-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-10
Last confirmed
yesterday

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
Upload A File To Storageupload-fileutilcnComponentsFree1 dep · 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

ToolDrift

What the AI coding tools changed last night

tooldrift.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 ToolDrift

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 ToolDrift

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 ToolDrift

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