Playground
Try a workflow and inspect the HTML behind each request.
Studio inventory
Request log ↓HTML
<div class="lab lab-expanded" data-lab data-inventory-revision="0">
<header class="lab-header"><div class="lab-breadcrumb"><span class="lab-workspace" aria-hidden="true">S</span><span>Studio</span><span class="lab-slash">/</span><span>Inventory</span></div><span class="lab-live"><i></i> Live demo</span></header>
<div class="lab-body">
<div class="lab-heading"><div><h2>Products</h2><p>Manage your product catalog.</p></div>
<button type="button" id="add-product" class="rl-button lab-add" aria-haspopup="dialog" hx-get="/demo/products/new" hx-target="#lab-overlay" hx-sync="#lab-overlay:replace"><span class="lab-icon lab-icon-plus" aria-hidden="true"></span> <span>Add product</span></button>
</div>
<form id="lab-filters" class="lab-toolbar" role="search" hx-get="/demo/products" hx-target="#product-results-frame" hx-swap="innerHTML" hx-sync="this:replace"
hx-trigger="submit, input changed delay:200ms from:find [type=search], change">
<label class="lab-search"><span class="lab-icon lab-icon-search" aria-hidden="true"></span> <span class="lab-sr-only">Search products</span><input id="lab-search" type="search" name="q" value="" placeholder="Search products…" autocomplete="off"></label>
<label class="lab-filter"><span class="lab-sr-only">Filter by category</span><select class="rl-select" name="filterCategory"><option value="">All categories</option><option>Furniture</option><option>Lighting</option><option>Objects</option><option>Textiles</option></select></label>
<label class="lab-filter lab-order"><span class="lab-sr-only">Sort products</span><select class="rl-select" name="order"><option value="">Default order</option><option value="name">Sort by name</option></select></label>
</form>
<p class="lab-request-error" data-lab-request-error role="alert" hidden></p>
<div id="product-results-frame"><div id="product-results">
<div class="lab-table-wrap">
<table class="rl-table lab-table">
<thead><tr><th scope="col">Product</th><th scope="col">Status</th><th scope="col">Category</th><th scope="col"><span class="lab-sr-only">Actions</span></th></tr></thead>
<tbody>
<tr id="product-1">
<th scope="row"><div class="lab-product">
<span class="lab-thumbnail lab-thumbnail-lilac" aria-hidden="true"><span></span></span>
<span class="lab-product-name"><strong>Arc Lounge Chair</strong><small>RL-1042</small></span>
</div></th>
<td><span class="lab-status lab-status-live">Active</span></td>
<td class="lab-category">Furniture</td>
<td class="lab-row-action"><button type="button" id="edit-product-1" class="rl-button lab-edit" aria-label="Edit Arc Lounge Chair" aria-haspopup="dialog"
hx-get="/demo/products/1/edit" hx-target="#lab-overlay" hx-sync="#lab-overlay:replace"><span class="lab-icon lab-icon-edit" aria-hidden="true"></span></button></td>
</tr>
<tr id="product-2">
<th scope="row"><div class="lab-product">
<span class="lab-thumbnail lab-thumbnail-peach" aria-hidden="true"><span></span></span>
<span class="lab-product-name"><strong>Halo Pendant</strong><small>RL-1078</small></span>
</div></th>
<td><span class="lab-status lab-status-draft">Draft</span></td>
<td class="lab-category">Lighting</td>
<td class="lab-row-action"><button type="button" id="edit-product-2" class="rl-button lab-edit" aria-label="Edit Halo Pendant" aria-haspopup="dialog"
hx-get="/demo/products/2/edit" hx-target="#lab-overlay" hx-sync="#lab-overlay:replace"><span class="lab-icon lab-icon-edit" aria-hidden="true"></span></button></td>
</tr>
<tr id="product-3">
<th scope="row"><div class="lab-product">
<span class="lab-thumbnail lab-thumbnail-mint" aria-hidden="true"><span></span></span>
<span class="lab-product-name"><strong>Fold Side Table</strong><small>RL-1116</small></span>
</div></th>
<td><span class="lab-status lab-status-live">Active</span></td>
<td class="lab-category">Furniture</td>
<td class="lab-row-action"><button type="button" id="edit-product-3" class="rl-button lab-edit" aria-label="Edit Fold Side Table" aria-haspopup="dialog"
hx-get="/demo/products/3/edit" hx-target="#lab-overlay" hx-sync="#lab-overlay:replace"><span class="lab-icon lab-icon-edit" aria-hidden="true"></span></button></td>
</tr>
<tr id="product-4">
<th scope="row"><div class="lab-product">
<span class="lab-thumbnail lab-thumbnail-sky" aria-hidden="true"><span></span></span>
<span class="lab-product-name"><strong>Forma Vase</strong><small>RL-1140</small></span>
</div></th>
<td><span class="lab-status lab-status-live">Active</span></td>
<td class="lab-category">Objects</td>
<td class="lab-row-action"><button type="button" id="edit-product-4" class="rl-button lab-edit" aria-label="Edit Forma Vase" aria-haspopup="dialog"
hx-get="/demo/products/4/edit" hx-target="#lab-overlay" hx-sync="#lab-overlay:replace"><span class="lab-icon lab-icon-edit" aria-hidden="true"></span></button></td>
</tr>
<tr id="product-5">
<th scope="row"><div class="lab-product">
<span class="lab-thumbnail lab-thumbnail-rose" aria-hidden="true"><span></span></span>
<span class="lab-product-name"><strong>Dune Throw</strong><small>RL-1151</small></span>
</div></th>
<td><span class="lab-status lab-status-archived">Archived</span></td>
<td class="lab-category">Textiles</td>
<td class="lab-row-action"><button type="button" id="edit-product-5" class="rl-button lab-edit" aria-label="Edit Dune Throw" aria-haspopup="dialog"
hx-get="/demo/products/5/edit" hx-target="#lab-overlay" hx-sync="#lab-overlay:replace"><span class="lab-icon lab-icon-edit" aria-hidden="true"></span></button></td>
</tr>
<tr id="product-6">
<th scope="row"><div class="lab-product">
<span class="lab-thumbnail lab-thumbnail-peach" aria-hidden="true"><span></span></span>
<span class="lab-product-name"><strong>Arc Task Lamp</strong><small>SL-204 · Soft ivory</small></span>
</div></th>
<td><span class="lab-status lab-status-live">Active</span></td>
<td class="lab-category">Lighting</td>
<td class="lab-row-action"><button type="button" id="edit-product-6" class="rl-button lab-edit" aria-label="Edit Arc Task Lamp" aria-haspopup="dialog"
hx-get="/demo/products/6/edit" hx-target="#lab-overlay" hx-sync="#lab-overlay:replace"><span class="lab-icon lab-icon-edit" aria-hidden="true"></span></button></td>
</tr></tbody>
</table>
</div>
<div class="lab-footer"><span role="status">6 products</span><span><i></i> Server-rendered HTML</span></div>
</div></div>
</div>
<div id="lab-overlay"></div>
</div>HTTP exchange
Use the preview to see the request and the HTML your server returns.Use in your app
Point the product URLs at your inventory routes. The standalone example includes the editable table, validation, confirmed deletion and the server that handles them.
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-inventory.css">
<script defer src="/vendor/htmx.min.js"></script>
<script defer src="/mero.js"></script>
<script defer src="/mero-forms.js"></script>
<script defer src="/mero-inventory.js"></script>Server source · site/inventory-routes.mjs
Download runnable inventory example ↓