Playground
Try a workflow and inspect the HTML behind each request.
Workspace settings
Request log ↓HTML
<form class="rl-settings" id="layout-settings" data-rl-return-focus="#settings-save" data-rl-form hx-post="/demo/settings" hx-target="this" hx-swap="outerHTML">
<section aria-labelledby="workspace-details">
<h2 id="workspace-details">General</h2>
<p>Choose the name your team sees in the workspace.</p>
<div class="rl-field">
<label class="rl-label" for="workspace-name">Workspace name</label>
<input class="rl-input" id="workspace-name" name="name" required maxlength="48" value="Studio">
</div>
</section>
<section aria-labelledby="workspace-notifications">
<h2 id="workspace-notifications">Notifications</h2>
<label class="rl-row"><input type="checkbox" class="rl-switch" role="switch" name="digest" value="on" checked> Weekly inventory digest</label>
</section>
<p role="alert" data-rl-form-error hidden></p>
<div class="rl-settings-actions"><button class="rl-button rl-button-primary" id="settings-save" type="submit">Save settings</button></div>
</form>HTTP exchange
Use the preview to see the request and the HTML your server returns.Use in your app
POST /demo/settings returns the saved form. On a validation error it returns the submitted values and field errors with HTTP 422. On success the HX-Trigger-After-Settle header announces the save.
Serve these assets from the download’s public/ directory. Add the tags to your page head.
Page assets
<link rel="stylesheet" href="/mero.css">
<link rel="stylesheet" href="/mero-layouts.css">
<script defer src="/vendor/htmx.min.js"></script>
<script defer src="/mero.js"></script>
<script defer src="/mero-forms.js"></script>Server source · server.mjs
Download full example source ↓