Skip to content

Block 295 of 297

Thumbnail Gallery

A large captioned photo stage over a thumbnail strip; each new photo rises out of its thumbnail. Shows a 3 / 12 count.

Puck key
GalleryThumbnailsBlock
Export
galleryThumbnailsBlock
React component
<GalleryThumbnails />
Files
components/puck/gallery-thumbnails-block.tsx
components/puck/gallery-thumbnails.client.tsx
Dependencies
gsap
License
MIT (GSAP has its own license)

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A large captioned photo stage with a strip of thumbnails beneath it. Choosing a thumbnail brings the new photo up out of it, with a caption and credit line under the image. Thumbnails are plain jump links, so the gallery still works without JavaScript. The photo crops to 4:3 on phones and 3:2 from small screens up.

  • Construction or renovation progress for a capital project
  • Event recaps and photo essays
  • Facility tours for a venue, campus or park
Writing the content
  • Photos allows up to 24, and an entry with no Image URL is skipped. Landscape photos at least 1600px wide work best.
  • Write Caption as a full sentence about what's happening; use Credit or date for the photographer and when it was taken.
  • Gallery name isn't visible but is announced by screen readers, such as "Construction photos".
  • The thumbnail strip appears only when there are two or more photos.
Accessibility
  • Each thumbnail is a link labelled "Show photo 3 of 12", and the active one carries aria-current; thumbnail images use empty alt so names aren't repeated.
  • Arrow keys and the previous and next buttons step through photos, and inactive photos are inert.
  • A live region announces the photo change, and reduced motion swaps photos without the rising transition.
Customizing the code
  • Requires gsap and gallery-thumbnails.client.tsx. Thumbnail size is w-20 sm:w-28, and the active ring is ring-indigo-600.
  • The section is capped at max-w-5xl; widen it for a bigger stage.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Eyebrowtext
  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Gallery nametext
  • Photosarray