← All examples

Search + debounce

Type in the box. Minu waits 300 ms after the last keystroke, sends the value as a GET parameter, and extracts only #search-results from the full HTML response.

Searching…

Results appear here after you type.

How it works

  1. keyup is the base event.
  2. changed skips repeats where the value did not change.
  3. delay:300ms debounces the request until typing pauses.
  4. The input is the trigger, so its name=q value is sent as ?q=….
  5. The server returns a complete HTML document. minu-select="#search-results" extracts just that fragment before swapping into #search-panel.
<input name="q"
       minu-get="/demo/search"
       minu-trigger="keyup changed delay:300ms"
       minu-target="#search-panel"
       minu-select="#search-results">

<div id="search-panel"></div>

Try clearing the field. The empty value is sent too, so the server returns the full menu.