Skip to content

Button

Check current stock. While the request runs, the button shows a spinner and blocks a second submission.

View template

The server returns an HTML fragment for the live output. After a failed request the form shows an inline error and enables the button for a retry.

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="/vendor/htmx.min.js"></script>
<script defer src="/mero.js"></script>
<script defer src="/mero-forms.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 ↓