Skip to content

gallery

Two to four photos or screenshots under the title, filling the slide in an asymmetric arrangement.

Use the gallery layout to show two to four pictures together: screens of a product or a flow, or one subject seen from several places. The first picture is the lead and takes the largest frame; the others share the rest, each with an optional caption under it.

Example

lookbook / gallery-placesOpen full deck
decks/lookbook/slides/gallery-places.mdxmdx
---
layout: gallery
title: Booked at 08:42, at the door at 09:21
eyebrow: One loaf, three places
surface: default
pictures:
  - src: ../assets/scenes/handover.svg
    alt: Aoife hands a warm Brightloaf bag to an older woman at her front door, the hall lit behind her
    caption: "09:21 · At the door of 14 Weir Street, flat 2"
    focal: 66% 50%
  - src: ../assets/scenes/inside-the-hub.svg
    alt: Inside the Old Town hub, a rider scanning a parcel's label beside the racks and a parked cargo bike
    caption: "08:50 · Into slot B3 at the Old Town hub"
    focal: 35% 50%
  - src: ../assets/scenes/rider-old-town.svg
    alt: Aoife riding through an Old Town street in morning sun, a Brightloaf bag on the box
    caption: "08:51 · Out on loop 14, stop 7 of 9"
    focal: 75% 55%
budget: 25s
---

Brightloaf's loaf for 14 Weir Street: 31 minutes from the rack to the door.

<Notes>
`gallery` with three pictures and captions on the default surface; use it for one subject seen in three places or moments, the one that matters most as the lead.
Start at the door: 09:21, three minutes before the time we promised, the loaf still warm. It got there like every drop does. At ten to nine it went into slot B3 at the Old Town hub; a minute later Aoife's loop left with it, seventh of nine stops.
</Notes>

Slide 156 of the lookbook deckView on GitHub

Notice three things in the source. The doorstep photo comes first, so it is the lead on the left. Each picture has a focal: that keeps its subject in view when the frame crops it. And surface: default sets the slide on the brand’s default surface instead of the layout’s own, inverse.

When to use it

  • You have two to four pictures and one point about them. pictures: is required and takes two to four entries; the title (up to 60 characters) says what they show together.
  • One picture matters most. Put it first: with two pictures the lead takes the left two thirds and the other a tall frame, as a phone screen needs; with three it takes the left seven columns; with four, the left half.
  • The words are short. The body is one sentence of at most 14 words, and a caption is at most 64 characters, or 40 when there are four pictures.
  • Screenshots should not be cropped. Set fit: contain on each one to show it whole, as the lookbook’s gallery-screens slide does.

Pick another layout when the pictures are not the whole slide:

  • One picture with text beside it: use split.
  • One photo across the slide: use image.
  • Pictures mixed with figures: use bento.
  • One product screen to look at closely: use screen.
  • Two pictures of one thing before and after a change: use before-after.

Reference

Common mistakes

  • Putting the pictures in the body. The pictures belong in pictures:; the body is one sentence. A list in the body fails deck lint with slot-content: “The body slot holds a list of 2 items; the gallery layout sets it as text.”
  • Long captions with four pictures. The four-picture variant cuts captions to 40 characters. A 45-character caption is a schema error: “pictures[0].caption: The gallery layout sets at most 40 characters here (four pictures), got 45.”
  • A wrong path. A src that names no file is a media-missing error that prints the path it looked for. Paths are relative to the slide file with ./ or ../, or written from the deck folder (assets/street.jpg).
  • A fifth picture. pictures: takes at most four. Split the set over two slides, or pick the four that make the point.
  • Text over the photo. The layout never sets text over a picture; a caption always stands under its picture. For a line over a photo, use image.
  • split: one picture with a title and text beside it.
  • image: one photo edge to edge, with optional text over a scrim.
  • bento: tiles of unequal weight that mix pictures with figures and text.
  • screen: one product screen shown whole in a drawn frame, with numbered callouts.
  • before-after: two pictures at the same size, labelled Before and After.

How image paths resolve and what deck lint checks about images is on media.

Type to search…

↑↓ navigate↵ selectEsc close