GALLERIES / FREE HTML + ASTRO

Habitat architectural gallery

An editorial architectural gallery with a panoramic lead image, staggered supporting images and a keyboard-operated viewer.

Try the design

Open demo ↗

Preview links stay in the example. Copy the source to use your own destinations. Form previews never send information.

Copy the source

<section
  class="fct-habitat-project-gallery"
  data-snippet="habitat-project-gallery"
  aria-labelledby="fct-habitat-project-gallery-title"
>
  <div class="r-inner">
    <div class="r-gallery-heading">
      <p class="r-micro">HABITAT / SPACES & STORIES</p>
      <h2 id="fct-habitat-project-gallery-title">
        In good<br /><span class="r-italic">company.</span>
      </h2>
      <p>A study in warm materials,<br />natural light and room to live.</p>
    </div>
    <div class="r-gallery-grid">
      <figure class="r-view r-view-0">
        <a href="images/living.webp" data-gallery-index="0"
          ><img
            src="images/living.webp"
            width="1120"
            height="747"
            alt="Tall living room with pale seating and soft curtains"
            loading="eager"
        /></a>
        <figcaption>
          <span>01 / Material & proportion.</span><span aria-hidden="true">↗</span>
        </figcaption>
      </figure>
      <figure class="r-view r-view-1">
        <a href="images/window.webp" data-gallery-index="1"
          ><img
            src="images/window.webp"
            width="1120"
            height="747"
            alt="Green sofa beneath a tall arched window"
            loading="lazy"
        /></a>
        <figcaption><span>02 / Room for light.</span><span aria-hidden="true">↗</span></figcaption>
      </figure>
      <figure class="r-view r-view-2">
        <a href="images/arch.webp" data-gallery-index="2"
          ><img
            src="images/arch.webp"
            width="1120"
            height="747"
            alt="Arched mirror above timber cabinetry in a planted interior"
            loading="lazy"
        /></a>
        <figcaption>
          <span>03 / The quieter details.</span><span aria-hidden="true">↗</span>
        </figcaption>
      </figure>
      <aside class="r-project-index">
        <span class="r-micro">Portfolio notes / Example content</span>
        <p>Thoughtful spaces,<br />made for <span class="r-italic">living.</span></p>
        <dl>
          <div>
            <dt>Focus</dt>
            <dd>Interior inspiration</dd>
          </div>
          <div>
            <dt>Materials</dt>
            <dd>Natural textures and light</dd>
          </div>
          <div>
            <dt>Photography</dt>
            <dd>Separate illustrative settings</dd>
          </div>
        </dl>
        <a class="r-link" href="contact.html">Discuss a space <span aria-hidden="true">↗</span></a>
      </aside>
    </div>
    <dialog aria-label="Enlarged project image">
      <button type="button" data-close>Close ×</button>
      <figure>
        <img width="1120" height="747" alt="" />
        <figcaption></figcaption>
      </figure>
      <div class="r-dialog-controls">
        <button type="button" data-prev>Previous</button><span role="status"></span
        ><button type="button" data-next>Next</button>
      </div>
    </dialog>
  </div>
</section>

Where this design fits

The gallery uses different image scales to tell a project story instead of placing every photograph in identical cards. Captions and a compact project index preserve a clear reading order on mobile.

  • Panoramic lead image
  • Staggered editorial image grid
  • Keyboard lightbox and focus return

What is included

The HTML ZIP includes a standalone demo, reusable markup, scoped CSS, its small JavaScript runtime, a license and setup notes. The Astro ZIP includes Snippet.astro, self-hosted fonts and asset license notes. It can be imported into an existing Astro page or layout.

Replace the sample photographs

Included photographs are licensed illustrative assets. They are not work created by the demonstration business. Update image paths, dimensions, captions and alternative descriptions for your own files. The ZIP includes the original image-source and license notes.

Add it to an HTML website

  1. Copy snippet.html into the relevant page section.
  2. Load snippet.css after your existing site stylesheet. The class prefix identifies this design.
  3. Load snippet.js once with defer. Keep the included keyboard behavior when adapting interactions.
  4. Replace example content and check mobile widths, zoom, links and keyboard focus in your actual website.

Use it in Astro

Copy Snippet.astro into src/components/, import it into your page or shared layout, and insert the component where the section belongs. Copy the fonts and any images folders into public/snippet-assets/habitat-project-gallery/; the component uses those public paths. Keep each generated prefix unique if you duplicate a component on one page.

Keep the section maintainable

Start with the variables at the top of the CSS for background, text and accent colors. Preserve semantic labels and focus styles. Existing site selectors can still affect imported markup, so test the combined result. Read the complete setup notes.

GOOD DESIGN, OCCASIONALLY.

Your next idea
could start here.

New templates, useful guides, and updates from us.
A little inspiration for whatever you’re building.