BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Supabase UI Library/dropzone-nextjs

Dropzone (File Upload)

supabase-ui-library/dropzone-nextjs
UnverifiedComponent

Displays a control for easier uploading of files directly to Supabase Storage.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/aimultiple-benchmark/supabase-bench-gre-2/main/apps/ui-library/public/r/dropzone-nextjs.json

Source

registry/default/blocks/dropzone/components/dropzone.tsxraw.githubusercontent.com/aimultiple-benchmark/supabase-bench-gre-2/main/apps/ui-library/public/r/dropzone-nextjs.json · first 6 KB
1'use client'
2
3import { CheckCircle, File, Loader2, Upload, X } from 'lucide-react'
4import { createContext, useCallback, useContext, type PropsWithChildren } from 'react'
5
6import { cn } from '@/lib/utils'
7import { type UseSupabaseUploadReturn } from '@/registry/default/blocks/dropzone/hooks/use-supabase-upload'
8import { Button } from '@/registry/default/components/ui/button'
9
10export const formatBytes = (
11 bytes: number,
12 decimals = 2,
13 size?: 'bytes' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'ZB' | 'YB'
14) => {
15 const k = 1000
16 const dm = decimals < 0 ? 0 : decimals
17 const sizes = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
18
19 if (bytes === 0 || bytes === undefined) return size !== undefined ? `0 ${size}` : '0 bytes'
20 const i = size !== undefined ? sizes.indexOf(size) : Math.floor(Math.log(bytes) / Math.log(k))
21 return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
22}
23
24type DropzoneContextType = Omit<UseSupabaseUploadReturn, 'getRootProps' | 'getInputProps'>
25
26const DropzoneContext = createContext<DropzoneContextType | undefined>(undefined)
27
28type DropzoneProps = UseSupabaseUploadReturn & {
29 className?: string
30}
31
32const Dropzone = ({
33 className,
34 children,
35 getRootProps,
36 getInputProps,
37 ...restProps
38}: PropsWithChildren<DropzoneProps>) => {
39 const isSuccess = restProps.isSuccess
40 const isActive = restProps.isDragActive
41 const isInvalid =
42 (restProps.isDragActive && restProps.isDragReject) ||
43 (restProps.errors.length > 0 && !restProps.isSuccess) ||
44 restProps.files.some((file) => file.errors.length !== 0)
45
46 return (
47 <DropzoneContext.Provider value={{ ...restProps }}>
48 <div
49 {...getRootProps({
50 className: cn(
51 'border-2 border-gray-300 rounded-lg p-6 text-center bg-card transition-colors duration-300 text-foreground',
52 className,
53 isSuccess ? 'border-solid' : 'border-dashed',
54 isActive && 'border-primary bg-primary/10',
55 isInvalid && 'border-destructive bg-destructive/10'
56 ),
57 })}
58 >
59 <input {...getInputProps()} />
60 {children}
61 </div>
62 </DropzoneContext.Provider>
63 )
64}
65const DropzoneContent = ({ className }: { className?: string }) => {
66 const {
67 files,
68 setFiles,
69 onUpload,
70 loading,
71 successes,
72 errors,
73 maxFileSize,
74 maxFiles,
75 isSuccess,
76 } = useDropzoneContext()
77
78 const exceedMaxFiles = files.length > maxFiles
79
80// … truncated

What it pulls in

npm packages

  • react-dropzone
  • lucide-react
  • @supabase/ssr@latest
  • @supabase/supabase-js@latest

Other registry items

  • button

Files it writes

  • registry/default/blocks/dropzone/components/dropzone.tsx
  • registry/default/blocks/dropzone/hooks/use-supabase-upload.ts
  • registry/default/clients/nextjs/lib/supabase/client.ts
  • registry/default/clients/nextjs/lib/supabase/middleware.ts
  • registry/default/clients/nextjs/lib/supabase/server.ts

Facts

Registry
Supabase UI Library
Type
registry:component
Access
Unverified
Files written
5
Licence
the repository states none
In the index
at or before 2026-08-08
Last confirmed
yesterday

Go to the source

supabase.com DrAkhilKolli/ExperimentSupabase on GitHub Raw registry item This item as JSON

More from Supabase UI Library

All 2 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Current User Avatarcurrent-user-avatar-nextjsSupabase UI LibraryComponentsUnverified2 deps · 6 files
Current User Avatarcurrent-user-avatar-reactSupabase UI LibraryComponentsUnverified1 dep · 4 files
Current User Avatarcurrent-user-avatar-react-routerSupabase UI LibraryComponentsUnverified2 deps · 5 files
Current User Avatarcurrent-user-avatar-tanstackSupabase UI LibraryComponentsUnverified2 deps · 5 files
Dropzone (File Upload)dropzone-reactSupabase UI LibraryComponentsUnverified3 deps · 3 files
Dropzone (File Upload)dropzone-react-routerSupabase UI LibraryComponentsUnverified4 deps · 4 files
Dropzone (File Upload)dropzone-tanstackSupabase UI LibraryComponentsUnverified4 deps · 4 files
Avatar Stack with Realtime Presencerealtime-avatar-stack-nextjsSupabase UI LibraryComponentsUnverified2 deps · 8 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