File Drop Zone

A file drop zone component.

Installation

Usage

Custom placeholder:

Text Area

You can use the Textarea component to allow users to paste or drag and drop files into a textarea.

Form

Schema:

Server:

API Reference

FileDropZone.

Root

The root file drop zone component. Renders a hidden file input element.

PropTypeDefault
ref? $bindable
HTMLInputElement null
id?
string -
children?
Snippet -
onUpload
function -
maxFiles?
number -
fileCount?
number -
maxFileSize?
number -
onFileRejected?
function -
accept?
string -
FileDropZone.

Trigger

The trigger element for the file drop zone. Renders as a label that activates the file input. Provides a default UI if no children are provided.

PropTypeDefault
ref? $bindable
HTMLLabelElement null
children?
Snippet -
FileDropZone.

Textarea

A textarea component that supports file uploads via drag-and-drop, paste, and click-to-select. Integrates with the FileDropZone root component.

PropTypeDefault
child?
Snippet -
onpaste?
function -
ondragover?
function -
ondrop?
function -