Skip to content

Autocomplete

Request matching options from the server as a user types.

View template

HTMX replaces the options with a server-rendered fragment. Use the arrow keys and Enter to select a result. A search without matches leaves the empty message visible.

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>

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 ↓