GALLERIES / FREE HTML + ASTRO

Indexworks filterable project gallery

A project gallery with grid and list views, category filtering, search, sorting and a keyboard-operated image 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-indexworks-project-gallery"
  data-snippet="indexworks-project-gallery"
  aria-labelledby="fct-indexworks-project-gallery-title"
>
  <div class="c-inner">
    <header class="c-gallery-heading">
      <div>
        <p class="c-kicker">INDEXWORKS / A VISUAL PROJECT INDEX</p>
        <h2 id="fct-indexworks-project-gallery-title">Spaces & structures.</h2>
      </div>
      <p>A collection of illustrative studies.<br />Browse by type, title or year.</p>
    </header>
    <form class="c-gallery-controls">
      <fieldset disabled>
        <legend class="c-visually-hidden">Filter and sort project studies</legend>
        <label
          >Find a study<input
            name="search"
            type="search"
            placeholder="Try workplace"
            maxlength="100" /></label
        ><label
          >Type<select name="type">
            <option value="all">All types</option>
            <option value="architecture">Architecture</option>
            <option value="residential">Residential</option>
            <option value="workplace">Workplace</option>
          </select></label
        ><label
          >Sort<select name="sort">
            <option value="newest">Newest first</option>
            <option value="oldest">Oldest first</option>
            <option value="title">Title A–Z</option>
          </select></label
        ><button type="reset">Reset filters</button>
      </fieldset>
    </form>
    <div class="c-gallery-toolbar">
      <p role="status" data-gallery-status>6 studies</p>
      <div role="group" aria-label="Gallery view">
        <button type="button" data-view="grid" aria-pressed="true" disabled>Grid</button
        ><button type="button" data-view="list" aria-pressed="false" disabled>List</button>
      </div>
    </div>
    <ul class="c-projects" data-current-view="grid">
      <li
        data-project
        data-type="workplace"
        data-title="Workplace exterior"
        data-year="2025"
        data-image="0"
      >
        <a class="c-project-image" href="images/building.webp" data-gallery-index="0"
          ><img
            src="images/building.webp"
            width="1120"
            height="747"
            alt="Glass and brick facade of an office building"
            loading="eager"
        /></a>
        <div class="c-project-caption">
          <h3><a href="images/building.webp" data-gallery-index="0">Workplace exterior</a></h3>
          <p><span>Workplace</span><span>2025</span></p>
        </div>
      </li>
      <li
        data-project
        data-type="residential"
        data-title="Room study"
        data-year="2024"
        data-image="1"
      >
        <a class="c-project-image" href="images/room.webp" data-gallery-index="1"
          ><img
            src="images/room.webp"
            width="1120"
            height="747"
            alt="Living room with pale seating and timber furniture"
            loading="eager"
        /></a>
        <div class="c-project-caption">
          <h3><a href="images/room.webp" data-gallery-index="1">Room study</a></h3>
          <p><span>Residential</span><span>2024</span></p>
        </div>
      </li>
      <li
        data-project
        data-type="architecture"
        data-title="Structural detail"
        data-year="2023"
        data-image="2"
      >
        <a class="c-project-image" href="images/structure.webp" data-gallery-index="2"
          ><img
            src="images/structure.webp"
            width="1120"
            height="747"
            alt="White steel frames against the sky"
            loading="eager"
        /></a>
        <div class="c-project-caption">
          <h3><a href="images/structure.webp" data-gallery-index="2">Structural detail</a></h3>
          <p><span>Architecture</span><span>2023</span></p>
        </div>
      </li>
      <li
        data-project
        data-type="workplace"
        data-title="Shared meeting space"
        data-year="2022"
        data-image="3"
      >
        <a class="c-project-image" href="images/meeting.webp" data-gallery-index="3"
          ><img
            src="images/meeting.webp"
            width="1120"
            height="747"
            alt="Long meeting table with surrounding chairs"
            loading="lazy"
        /></a>
        <div class="c-project-caption">
          <h3><a href="images/meeting.webp" data-gallery-index="3">Shared meeting space</a></h3>
          <p><span>Workplace</span><span>2022</span></p>
        </div>
      </li>
      <li
        data-project
        data-type="residential"
        data-title="Living room study"
        data-year="2021"
        data-image="4"
      >
        <a class="c-project-image" href="images/living.webp" data-gallery-index="4"
          ><img
            src="images/living.webp"
            width="1120"
            height="747"
            alt="Interior with a sofa, mirror and warm materials"
            loading="lazy"
        /></a>
        <div class="c-project-caption">
          <h3><a href="images/living.webp" data-gallery-index="4">Living room study</a></h3>
          <p><span>Residential</span><span>2021</span></p>
        </div>
      </li>
      <li
        data-project
        data-type="workplace"
        data-title="Working together"
        data-year="2020"
        data-image="5"
      >
        <a class="c-project-image" href="images/office.webp" data-gallery-index="5"
          ><img
            src="images/office.webp"
            width="1120"
            height="747"
            alt="Bright office with shared desks"
            loading="lazy"
        /></a>
        <div class="c-project-caption">
          <h3><a href="images/office.webp" data-gallery-index="5">Working together</a></h3>
          <p><span>Workplace</span><span>2020</span></p>
        </div>
      </li>
    </ul>
    <p class="c-gallery-empty" hidden>
      No studies match. Try a different type or clear the search.
    </p>
    <dialog aria-label="Enlarged study image">
      <button type="button" data-close>Close ×</button>
      <figure>
        <img width="1120" height="747" alt="" />
        <figcaption></figcaption>
      </figure>
      <div class="c-viewer-controls">
        <button type="button" data-prev>Previous</button
        ><span role="status" data-viewer-count></span><button type="button" data-next>Next</button>
      </div>
    </dialog>
    <noscript
      ><p class="c-note">
        Filters and view controls need JavaScript. All six studies are visible; image links open the
        full-size photographs.
      </p></noscript
    >
    <p class="c-note c-gallery-note">
      Licensed illustrative photographs, fictional study titles and sample years. These are not
      projects completed by Indexworks.
    </p>
  </div>
</section>

Where this design fits

Unframed photographs and concise labels put the work ahead of decorative cards. Search, type and sort controls update the same project list. The native dialog cycles through the currently visible results, while no-JavaScript visitors retain all images and normal full-size links.

  • Grid/list views with one semantic project list
  • Combined search, category filter and sort
  • Filtered image viewer with keyboard controls and focus return

The real-site reference

David Chipperfield Architects projects ↗

The live project index emphasizes unframed images, concise labels and grid/list filtering. Indexworks adapts that project-browsing pattern with original styling, fictional studies and separate licensed photographs. Reference inspected 2 November 2026. This example has its own branding, content and code; it is not affiliated with the reference product.

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, local sample images and image credits. 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 images into public/snippet-assets/indexworks-project-gallery/images; the component uses that public path. 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.