+234 Design System

Figure

An image with its caption and credit. The credit is not decoration: the photographs belong to the outlets we summarise.

When to use it

Hero image with caption and credit

Queue of vehicles at a filling station in Lagos
Motorists queue in Ikeja as pump prices move ahead of the last official figure. Photograph: Reuters
HTML
<figure class="p234-figure">
  <img src="data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 450'%3E%3Crect width='800' height='450' fill='%23ddd8cf'/%3E%3Ctext x='400' y='230' font-family='sans-serif' font-size='22' fill='%236e6b62' text-anchor='middle'%3EArticle image%3C/text%3E%3C/svg%3E" alt="Queue of vehicles at a filling station in Lagos" width="800" height="450">
  <figcaption>
    Motorists queue in Ikeja as pump prices move ahead of the last official figure.
    <span class="p234-figure__credit">Photograph: Reuters</span>
  </figcaption>
</figure>

Sizes

There is one shape, 16:9, because that is what the image service returns. Everything else is a named exception.

--p234-figure-ratio16 / 9The default, and what img.plus234feed.com returns.
--p234-figure-ratio-portrait3 / 4People. A politician's photograph cropped to 16:9 loses the face.
--p234-figure-ratio-square1 / 1Logos and avatars.
--p234-figure-hero-max-height31.25rem500px. A hero taller than this pushes the first paragraph off a laptop screen.
--p234-figure-inset-width45%An image set beside the text on wide screens.
p234-figure--hero16:9Lead image on an article, capped at 500px tall so the first paragraph stays on screen
p234-figure16:9Default, inside the body at the text width
p234-figure--inset16:9Beside the text from 768px, full width below that
p234-figure--portrait3:4People. A face cropped to 16:9 is a forehead and a chin
p234-figure--square1:1Logos and avatars
p234-figure--unsizedas sentImages the resizer cannot touch: letterboxed, never cropped blind

Portrait and inset

Portrait of a legislator
Senator for Yobe North. Photograph: NASS
HTML
<figure class="p234-figure p234-figure--portrait" style="max-width:14rem">
  <img src="data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 400'%3E%3Crect width='300' height='400' fill='%23ddd8cf'/%3E%3Ctext x='150' y='205' font-family='sans-serif' font-size='18' fill='%236e6b62' text-anchor='middle'%3EPortrait 3:4%3C/text%3E%3C/svg%3E" alt="Portrait of a legislator" width="300" height="400">
  <figcaption>Senator for Yobe North. <span class="p234-figure__credit">Photograph: NASS</span></figcaption>
</figure>

What the service actually serves

Requests go to the image CDN, which returns WebP at the width asked for, in 16:9. Ask for the width the image is drawn at, doubled for phone screens: a 140px thumbnail requesting 800 downloaded about five times the bytes it showed.

Two things to know before trusting the shape:

Alt text and caption

The alt text describes the image for someone who cannot see it. The caption says why the image is on the page. If the caption already describes the picture fully, the alt text can be empty and the image marked decorative, but that is rare on a news page.

Loading

The hero image is usually the largest thing on an article and sets the page's load speed. It should be served at the size it renders, in a modern format, and it should not be lazy-loaded: it is the first thing in view.

Tokens this component reads

--p234-color-paper-sunk--p234-color-ink-muted--p234-color-ink-subtle--p234-type-caption-*--p234-radius-sm--p234-space-3--p234-space-6--p234-measure-text