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

Morphing Dialog

Project cards that grow into a dialog with a large photo and details on click, and shrink back into place when closed. Uses the View Transitions API with its own FLIP fallback. Escape, focus and focus return are handled.

How to use it

  1. Paste the HTML where the components 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.
<!-- Morphing Dialog · © 2026 NedDev BV · NedDev Lab-licentie (gratis gebruik, niet doorverkopen) · neddev.com/nl/lab/gebruik/#licentie -->
<div class="jouw-container">
<div class="h3md">
  <div class="h3md-rij">
    <button class="h3md-kaart h3md-kaart--groot" type="button" data-i="0">
      <img src="https://neddev.com/lab-media/carousel-basis-4.webp" alt="" draggable="false">
      <span class="h3md-t">Keuken aan de Vecht</span><span class="h3md-m">Maarssen · 2026</span>
    </button>
    <button class="h3md-kaart" type="button" data-i="1">
      <img src="https://neddev.com/lab-media/carousel-basis-3.webp" alt="" draggable="false">
      <span class="h3md-t">Badkamer in de Pijp</span><span class="h3md-m">Amsterdam · 2025</span>
    </button>
  </div>
  <div class="h3md-scherm" hidden></div>
  <div class="h3md-dlg" role="dialog" aria-modal="true" hidden>
    <img class="h3md-dimg" src="" alt="">
    <div class="h3md-dtxt">
      <h3 class="h3md-dt"></h3>
      <p class="h3md-dm"></p>
      <p class="h3md-dp"></p>
    </div>
    <button class="h3md-sluit" type="button" aria-label="Sluiten"><svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3.5 3.5l9 9M12.5 3.5l-9 9"/></svg></button>
  </div>
</div>
</div>

More components

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 →