Supabase Storage upload, drag and drop
The free upload dropzone with Supabase Storage as its uploader. Errors land on the file's row with a retry button. MIT.
The free upload dropzone with Supabase Storage as its uploader. Errors land on the file's row with a retry button. MIT.
"use client";
import UploadDropzone, { type Uploader } from "@/components/upload-dropzone/UploadDropzone";
import { createClient } from "@/lib/supabase/client";
const supabase = createClient();
const upload: Uploader = async (file, onProgress) => {
const path = `${crypto.randomUUID()}-${file.name}`;
const { error } = await supabase.storage.from("uploads").upload(path, file);
if (error) throw new Error(error.message); // shows on the file row, with a retry button
onProgress(100);
};
export default function UploadPage() {
return <UploadDropzone upload={upload} accept="image/*,.pdf" maxSize={10 * 1024 * 1024} />;
}import { createBrowserClient } from "@supabase/ssr";
export function createClient() {
return createBrowserClient(process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!);
}npx shadcn@latest add https://teodoravadani.github.io/qodesign-free/r/upload-dropzone.jsonAll comparisons, with prices read on each library's own site.
Yes. MIT licence, installed from the free registry.
Yes. Only the upload function changes.
Yes. The folder has a PROMPT.md. Paste it into Cursor, Lovable, v0 or Claude Code.
Yes, as a client component. Keep "use client" at the top of the file that renders it, as in the snippet above. App Router and Pages Router both work.