Figure example

Figure with caption

The image will fill the available space but not exceed the width of the container or its own width. The caption will always be the same width as the image.

How it looks (preview)

An image of the lords chamber

The Lords Chamber on the 14th of August. A large number of people are in attendance, filling the seats in the lower and upper areas. Several people are wearing hats.

How to call this example

<%= render "govuk_publishing_components/components/figure", {
  src: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/feature/image/54374/s630_the_lords_chamber.jpg",
  alt: "An image of the lords chamber",
  caption: "The Lords Chamber on the 14th of August. A large number of people are in attendance, filling the seats in the lower and upper areas. Several people are wearing hats."
} %>