Files
Terry SuttonandIvan Vasilov 7b3a63b389 UI lib/docs (#34448)
* Buncha docs

* Add prompts instructions

* Minor fixes.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-27 17:20:38 +00:00

52 lines
2.0 KiB
Plaintext

---
title: Dropzone (File Upload)
description: Displays a control for easier uploading of files directly to Supabase Storage
---
<ComponentPreview
name="dropzone-demo"
description="An alert with an icon, title and description. The title says 'Heads up!' and the description is 'You can add components to your app using the cli.'."
/>
## Installation
<BlockItem
name="dropzone-nextjs"
description="Displays a control for easier uploading of files directly to Supabase Storage"
/>
## Folder structure
<RegistryBlock itemName="dropzone-nextjs" />
## Introduction
Uploading files should be easy—this component handles the tricky parts for you.
The File Upload component makes it easy to add file uploads to your app, with built-in support for drag-and-drop, file type restrictions, image previews, and configurable limits on file size and number of files. All the essentials, ready to go.
## Features
- Drag-and-drop support
- Multiple file uploads
- File size and count limits
- Image previews for supported file types
- MIME type restrictions
- Invalid file handling
- Success and error states with clear feedback
## Usage
- Simply add this `<Dropzone />` component to your page and it will handle the rest.
- For control over file upload, you can pass in a `props` object to the component.
## Props
| Prop | Type | Default | Description |
| ------------------ | ---------- | ------- | ---------------------------------------------------- |
| `bucketName` | `string` | `null` | The name of the Supabase Storage bucket to upload to |
| `path` | `string` | `null` | The path or subfolder to upload the file to |
| `allowedMimeTypes` | `string[]` | `[]` | The MIME types to allow for upload |
| `maxFiles` | `number` | `1` | Maximum number of files to upload |
| `maxFileSize` | `number` | `1000` | Maximum file size in bytes |