# File Drop Zone

Mero UI 1.1.0 · Forms

Drop files on a large target or click it to use the native file picker.

[Integration patterns and API reference](../llms-patterns.txt)

## Default

Put the field in a plain <form method="post" enctype="multipart/form-data">. Without scripts the native file input shows inside the zone with its own file name, and the form submits as usual. With mero.js the input covers the whole zone, and a drop anywhere on a data-mero-drop zone fills its file input, whatever its name, and fires change. The zone gets data-dragging while files are over it, and data-mero-file-name lists the chosen files. Add multiple to accept several files. Your server still checks the type and size.

Page assets

```html
<link rel="stylesheet" href="/mero.css">
<script defer src="/mero.js"></script>
```

Template

````html
<div class="mero-scope" data-mero-scope>
  <div class="mero-field">
    <label class="mero-label" for="demo-drop-zone">Import contacts</label>
    <div class="mero-drop-zone" data-mero-drop>
      <input class="mero-file" id="demo-drop-zone" name="import" type="file" accept=".csv,.xlsx" aria-describedby="demo-drop-zone-hint">
      <p aria-hidden="true"><strong>Drop a CSV or XLSX file</strong></p>
      <p id="demo-drop-zone-hint">or click to choose one, up to 5 MB</p>
      <span data-mero-file-name aria-live="polite"></span>
    </div>
  </div>
</div>
````
