Forms
FileDropzone
A place to drop files, or to choose them: a real file input with its label, so a click, Enter or Space opens the picker. It checks the type and the size and says the limit when a file is over it. There is no upload code: hand the files to yours and pass their progress back in items, which it lists with a Progress, a check when done, or the error. The checks are there to help the person; check the type and the size again on your server.
Preview
- september-statement.pdf482 kB
Installation
// Resolves dependencies, copies the source, and installs npm packages automatically.
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| onFiles | (files: File[]) => void | - | The files that pass |
| accept | string | - | As the input takes it: "image/*,.pdf" |
| maxSize | number | - | Bytes; a file over it says the limit |
| multiple | boolean | false | Several at once |
| items | { id, name, size, progress?, error? }[] | - | progress from 0 to 1 while it uploads |
| onRemove | (id) => void | - | A × on each file |
| hint | ReactNode | - | The line under the title |