# Dropzone

> Source: https://design.nanatec.co.ke/components/dropzone/
> Where files are dropped or picked — a signed lease, photographs of a meter, a bank statement. It checks each file against `accept`, `max-size` and `max-files` as it arrives, keeps those that pass and says plainly why the others were turned away.
> Status: beta
> Since: v0.0.40

The kept files submit with the form under `name`. Show them with
`nana-file`, listening for `nana-change`, and call `removeFile()` when one
is taken out.

The zone is a button: Enter or Space opens the file browser, so it works
without a mouse.

## Preview

Drop a PDF or a photograph, or press the zone to browse. Anything larger than
5 MB, or of another type, is turned away with the reason.

## Installation

```html
<nana-dropzone label="Signed lease" name="lease" accept=".pdf" max-size="10485760"></nana-dropzone>
```

```js
const el = document.querySelector("nana-dropzone");
el.addEventListener("nana-change", (e) => console.log(e.detail));
```
