File Field
Ask for a different file after the server rejected the last one.
The watermark must be a PNG under 1 MB.
HTML
<div class="mero-scope" data-mero-scope>
<div class="mero-field">
<label class="mero-label" for="demo-file-error">Watermark</label>
<input class="mero-file" id="demo-file-error" name="watermark" type="file" accept="image/png" aria-invalid="true" aria-describedby="demo-file-error-message">
<p class="mero-field-error" id="demo-file-error-message">The watermark must be a PNG under 1 MB.</p>
</div>
</div>Render aria-invalid and the error from your server. The browser cannot keep the rejected file, so the person chooses it again.
Use in your app
Copy these tags into your page head once. Serve the files at the paths shown, then add the example’s template to your page.
Page assets
<link rel="stylesheet" href="/mero.css">
<script defer src="/mero.js"></script>