Drop Zone
Drop an image or use the native file picker and check the file.
HTML
<form class="rlw-upload" method="post" enctype="multipart/form-data" hx-post="/demo/workspace/upload" hx-encoding="multipart/form-data" hx-target="find output" hx-sync="this:replace" data-rlw-upload>
<label class="rlw-drop"><span aria-hidden="true" class="rlw-upload-icon">↑</span><strong>Drop a product image</strong><small>or choose a file · PNG or JPEG, up to 2 MB</small>
<input name="photo" type="file" accept="image/png,image/jpeg" required aria-label="Product image">
</label>
<span class="rlw-file-name" aria-live="polite"></span>
<button class="rl-button rl-button-sm rl-button-secondary" type="submit">Check image</button>
<output class="rlw-status" role="status"></output>
</form>HTTP exchange
Use the preview to see the request and the HTML your server returns.The local server checks the file signature and 2 MB limit, then discards the bytes. Your endpoint controls storage.
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">
<link rel="stylesheet" href="/mero-workspace.css">
<script defer src="/vendor/htmx.min.js"></script>
<script defer src="/mero.js"></script>
<script defer src="/mero-workspace.js"></script>Point the HTMX attributes at your own HTML endpoints. Use the live preview’s HTTP exchange to inspect the request and response.
Download library and examples ↓