Skip to main content

Internal review app NHS.UK frontend

Use design system guidance and examples to build consistent, accessible NHS services for the public and staff.

Deployed automatically from main branch (opens in new tab).

Images

These examples are used for automated tests and may not follow service manual best practice.

Images default

Open this example in a new tab: Images default

No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
Code

Markup

<figure class="nhsuk-image">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
  <figcaption class="nhsuk-image__caption">
    No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
  </figcaption>
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  caption: {
    text: "No specific amount of time is recommended, but a typical training session could take less than 20 minutes."
  }
}) }}
Code

Markup

<figure class="nhsuk-image nhsuk-u-width-one-quarter">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  alt: "A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.",
  width: "one-quarter"
}) }}
Code

Markup

<figure class="nhsuk-image nhsuk-u-width-one-third">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  alt: "A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.",
  width: "one-third"
}) }}
Code

Markup

<figure class="nhsuk-image nhsuk-u-width-one-half">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  alt: "A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.",
  width: "one-half"
}) }}
Code

Markup

<figure class="nhsuk-image nhsuk-u-width-two-thirds">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  alt: "A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.",
  width: "two-thirds"
}) }}
Code

Markup

<figure class="nhsuk-image nhsuk-u-width-three-quarters">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  alt: "A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.",
  width: "three-quarters"
}) }}
Code

Markup

<figure class="nhsuk-image nhsuk-u-width-full">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  alt: "A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.",
  width: "full"
}) }}

Images with custom HTML

Open this example in a new tab: Images with custom HTML

No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
Code

Markup

<figure class="nhsuk-image">
<img src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
  <figcaption class="nhsuk-image__caption">
    No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
  </figcaption>
</figure>

Macro

{% from "images/macro.njk" import image -%}

{% call image({
  caption:
    "No specific amount of time is recommended, but a typical training session could take less than 20 minutes."
}) %}
<img src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
{%- endcall %}

Images without background

Open this example in a new tab: Images without background

No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
Code

Markup

<figure class="nhsuk-image nhsuk-image--no-background">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
  <figcaption class="nhsuk-image__caption">
    No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
  </figcaption>
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  background: false,
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  caption:
    "No specific amount of time is recommended, but a typical training session could take less than 20 minutes."
}) }}
Code

Markup

<figure class="nhsuk-image nhsuk-image--no-border nhsuk-image--no-background">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  background: false,
  border: false,
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  alt: "A person in a bright pink athletic top, listening to music, pauses for thought during a short training session."
}) }}

Images without border

Open this example in a new tab: Images without border

No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
Code

Markup

<figure class="nhsuk-image nhsuk-image--no-border">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
  <figcaption class="nhsuk-image__caption">
    No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
  </figcaption>
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  border: false,
  src: "/nhsuk-frontend/assets/example-image-exercise.jpg",
  caption:
    "No specific amount of time is recommended, but a typical training session could take less than 20 minutes."
}) }}
Code

Markup

<figure class="nhsuk-image">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg" alt="Close-up of a person&#39;s tummy showing a number of creases in the skin under their belly button. Shown on light brown skin.">
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg",
  alt: "Close-up of a person's tummy showing a number of creases in the skin under their belly button. Shown on light brown skin."
}) }}

Images with srcset

Open this example in a new tab: Images with srcset

Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time.
Code

Markup

<figure class="nhsuk-image">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg" alt="" sizes="(max-width: 768px) 100vw, 66vw" srcset="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg 600w, /nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg 1000w">
  <figcaption class="nhsuk-image__caption">
    Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time.
  </figcaption>
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg",
  sizes: "(max-width: 768px) 100vw, 66vw",
  srcset:
    "/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg 600w, /nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg 1000w",
  caption:
    "Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time."
}) }}

Images with srcset and alt text

Open this example in a new tab: Images with srcset and alt text

Close-up of a person's tummy showing a number of creases in the skin under their belly button. Shown on light brown skin.
Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time.
Code

Markup

<figure class="nhsuk-image">
  <img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg" alt="Close-up of a person&#39;s tummy showing a number of creases in the skin under their belly button. Shown on light brown skin." sizes="(max-width: 768px) 100vw, 66vw" srcset="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg 600w, /nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg 1000w">
  <figcaption class="nhsuk-image__caption">
    Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time.
  </figcaption>
</figure>

Macro

{% from "images/macro.njk" import image -%}

{{ image({
  src: "/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg",
  sizes: "(max-width: 768px) 100vw, 66vw",
  srcset:
    "/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg 600w, /nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg 1000w",
  alt: "Close-up of a person's tummy showing a number of creases in the skin under their belly button. Shown on light brown skin.",
  caption:
    "Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time."
}) }}