BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/EdgeStore/uploader-provider

Uploader Provider

edgestore/uploader-provider
FreeComponent

A provider component and hook for managing file uploads with progress tracking and state management.

Live preview

live · rendered by the registry
Rendered by EdgeStore on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://edgestore.dev/r/uploader-provider.json

Source

examples/components/src/components/upload/uploader-provider.tsxedgestore.dev/r/uploader-provider.json · first 6 KB
1'use client';
2
3import * as React from 'react';
4
5/**
6 * Represents the possible statuses of a file in the uploader.
7 */
8export type FileStatus = 'PENDING' | 'UPLOADING' | 'COMPLETE' | 'ERROR';
9
10/**
11 * Represents the state of a file in the uploader.
12 */
13export type FileState = {
14 /** The file object being uploaded */
15 file: File;
16
17 /** Unique identifier for the file */
18 key: string;
19
20 /** Upload progress (0-100) */
21 progress: number;
22
23 /** Current status of the file */
24 status: FileStatus;
25
26 /** URL of the uploaded file (available when status is COMPLETE) */
27 url?: string;
28
29 /** Error message if the upload failed */
30 error?: string;
31
32 /** AbortController to cancel the upload */
33 abortController?: AbortController;
34
35 /** Whether the file should be automatically uploaded */
36 autoUpload?: boolean;
37};
38
39/**
40 * Represents a file that has completed uploading.
41 */
42export type CompletedFileState = Omit<FileState, 'status' | 'url'> & {
43 /** Status is guaranteed to be 'COMPLETE' */
44 status: 'COMPLETE';
45
46 /** URL is guaranteed to be available */
47 url: string;
48};
49
50/**
51 * Function type for handling file uploads.
52 */
53export type UploadFn<TOptions = unknown> = (props: {
54 /** The file to be uploaded */
55 file: File;
56
57 /** AbortSignal to cancel the upload */
58 signal: AbortSignal;
59
60 /** Callback to update progress */
61 onProgressChange: (progress: number) => void | Promise<void>;
62
63 /** Additional options */
64 options?: TOptions;
65}) => Promise<{ url: string }>;
66
67/**
68 * Context type for the UploaderProvider.
69 */
70type UploaderContextType<TOptions = unknown> = {
71 /** List of all files in the uploader */
72 fileStates: FileState[];
73
74 /** Add files to the uploader */
75 addFiles: (files: File[]) => void;
76
77 /** Update a file's state */
78 updateFileState: (key: string, changes: Partial<FileState>) => void;
79
80 /** Remove a file from the uploader */
81 removeFile: (key: string) => void;
82
83 /** Cancel an ongoing upload */
84 cancelUpload: (key: string) => void;
85
86 /** Start uploading files */
87 uploadFiles: (keysToUpload?: string[], options?: TOptions) => Promise<void>;
88
89 /** Reset all files */
90 resetFiles: () => void;
91
92 /** Whether any file is currently uploading */
93 isUploading: boolean;
94
95 /** Whether files should be automatically uploaded */
96 autoUpload?: boolean;
97};
98
99/**
100 * Props for the UploaderProvider component.
101 */
102type ProviderProps<TOptions = unknown> = {
103 /** React children or render function */
104 children:
105 | React.ReactNode
106// … truncated

Files it writes

  • examples/components/src/components/upload/uploader-provider.tsx

Facts

Registry
EdgeStore
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on EdgeStore edgestore.dev edgestorejs/edgestore on GitHub Raw registry item This item as JSON

More from EdgeStore

All 12 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Progress Barprogress-barEdgeStoreComponentsFreeno deps
Progress Circleprogress-circleEdgeStoreComponentsFreeno deps
Single Image Dropzonesingle-image-dropzoneEdgeStoreComponentsFree2 deps
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex