Services
Solutions
Industries
Regions
Book a call 085 369 7668 info@neddev.com

Expanding Search

A compact search button opens into a field with popular searches below it. Escape or a click outside closes it again. Handy in a crowded header.

How to use it

  1. Paste the HTML where the forms & inputs should appear.
  2. Add the CSS to your stylesheet. All classes are prefixed, so nothing clashes with your own styles.
  3. Add the JavaScript and call init() with the element that contains the HTML.
<!-- Expanding Search · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<form class="nzs" role="search" action="#" novalidate>
  <div class="nzs__vak">
    <label class="nzs__verborgen" for="nzs-veld">Zoeken in de tuinwinkel</label>
    <input id="nzs-veld" class="nzs__veld" type="search" placeholder="Zoek een product" autocomplete="off" tabindex="-1">
    <button class="nzs__knop" type="button" aria-expanded="false" aria-controls="nzs-tips" aria-label="Zoekveld openen"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="10.5" cy="10.5" r="6"/><path d="M15 15l5 5"/></svg></button>
  </div>
  <ul class="nzs__tips" id="nzs-tips" hidden>
    <li><button type="button" class="nzs__tip">Tuinset teak</button></li>
    <li><button type="button" class="nzs__tip">Parasol 3 meter</button></li>
    <li><button type="button" class="nzs__tip">Loungekussens</button></li>
    <li><button type="button" class="nzs__tip">Plantenbak cortenstaal</button></li>
  </ul>
  <p class="nzs__melding" aria-live="polite"></p>
</form>
</div>

More forms & inputs

Seen something you like?

Add it to your selection and send it over. We build your site around it, in your brand.

Get in touch →