Skip to main

Design System

  • Welcome
  • Colors
  • Typography
  • Spacing

CSS

  • Utilities
  • Compositions

Component Library

  • Aside
  • Audio Player
  • Authors
  • Banners
  • Block quotes
  • Brand
  • Breadcrumbs
  • Browser compatibility table
  • Button
  • Callout
  • Cards
  • Carousel
  • Code blocks
  • Compare
  • Counter
  • Details
  • Ellipsis
  • Eyebrow
  • Floating Action Button
  • Feature Card
  • Figure
  • Fixed width Image
  • Form Fields
  • Headline
  • Hero
  • Hero Image
  • Icon Button
  • Indicator
  • Labels
  • Lists
  • Numbered headers
  • Page Header
  • Pagination
  • Pill
  • Preview Pagination
  • Prose
  • Spinner
  • Stack Nav
  • Stats
  • Status List
  • Tables
  • Tabs
  • Generated table of contents
  • Toggle Switch
  • Tooltips

Figure - Component

Float figure Screenshot figure Size figure
View full screen
Code

Source (Nunjucks)

<figure>
<img alt="Dog holding a stick." decoding="auto" height="240" src="https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/QlgeHQrzaD9IOKBXB68I.jpg?auto=format" width="380">
<figcaption>This is the caption</figcaption>
</figure>

Output

<figure>
<img
alt="Dog holding a stick."
decoding="auto"
height="240"
src="https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/QlgeHQrzaD9IOKBXB68I.jpg?auto=format"
width="380"
/>

<figcaption>This is the caption</figcaption>
</figure>

Information

In order to use an image inside of a text body, wrap the actual image in <figure> tag. Use <figcaption> to add a caption to the image.

<figure> elements wrap the content inside of them.

Variants

Float figure

View full screen
Code

Source (Nunjucks)

<div class="prose">
<p> Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean porttitor hac integer consectetur penatibus commodo nunc proin tincidunt tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad magna ridiculus class lobortis maecenas orci semper </p>
<figure data-float="left">
<img alt="Alternative text" height="480" sizes="100vw" src="https://web-dev.imgix.net/image/admin/ZAID4J5TsJTcJs3qPNTp.png">
<figcaption>This figure floats left</figcaption>
</figure>
<p> Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean porttitor hac integer consectetur penatibus commodo nunc proin tincidunt tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad magna ridiculus class lobortis maecenas orci semper </p>
<p> Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean porttitor hac integer consectetur penatibus commodo nunc proin tincidunt tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad magna ridiculus class lobortis maecenas orci semper </p>
<figure data-float="right">
<img alt="Alternative text" height="480" sizes="100vw" src="https://web-dev.imgix.net/image/admin/ZAID4J5TsJTcJs3qPNTp.png">
<figcaption>This figure floats right</figcaption>
</figure>
<p> Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean porttitor hac integer consectetur penatibus commodo nunc proin tincidunt tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad magna ridiculus class lobortis maecenas orci semper </p>
<p> Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean porttitor hac integer consectetur penatibus commodo nunc proin tincidunt tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad magna ridiculus class lobortis maecenas orci semper </p>
</div>

Output

<div class="prose">
<p>
Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus
curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean
porttitor hac integer consectetur penatibus commodo nunc proin tincidunt
tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad
magna ridiculus class lobortis maecenas orci semper
</p>
<figure data-float="left">
<img
alt="Alternative text"
height="480"
sizes="100vw"
src="https://web-dev.imgix.net/image/admin/ZAID4J5TsJTcJs3qPNTp.png"
/>

<figcaption>This figure floats left</figcaption>
</figure>
<p>
Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus
curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean
porttitor hac integer consectetur penatibus commodo nunc proin tincidunt
tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad
magna ridiculus class lobortis maecenas orci semper
</p>
<p>
Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus
curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean
porttitor hac integer consectetur penatibus commodo nunc proin tincidunt
tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad
magna ridiculus class lobortis maecenas orci semper
</p>
<figure data-float="right">
<img
alt="Alternative text"
height="480"
sizes="100vw"
src="https://web-dev.imgix.net/image/admin/ZAID4J5TsJTcJs3qPNTp.png"
/>

<figcaption>This figure floats right</figcaption>
</figure>
<p>
Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus
curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean
porttitor hac integer consectetur penatibus commodo nunc proin tincidunt
tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad
magna ridiculus class lobortis maecenas orci semper
</p>
<p>
Euismod tellus phasellus sapien mus enim curabitur eu at fermentum luctus
curae dis cras ut magnis libero eros eget non scelerisque potenti dui aenean
porttitor hac integer consectetur penatibus commodo nunc proin tincidunt
tempus adipiscing volutpat ipsum justo hendrerit ultrices sit pulvinar ad
magna ridiculus class lobortis maecenas orci semper
</p>
</div>

Screenshot figure

View full screen
Code

Source (Nunjucks)

<div class="prose">
<p>Add <code>data-screenshot</code> attribute to add a border around a figure.</p>
<figure data-screenshot="true">
<img alt="Dog holding a stick." decoding="auto" height="240" src="https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/QlgeHQrzaD9IOKBXB68I.jpg?auto=format" width="380">
<figcaption>This figure gets a border.</figcaption>
</figure>
</div>

Output

<div class="prose">
<p>
Add <code>data-screenshot</code> attribute to add a border around a figure.
</p>
<figure data-screenshot="true">
<img
alt="Dog holding a stick."
decoding="auto"
height="240"
src="https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/QlgeHQrzaD9IOKBXB68I.jpg?auto=format"
width="380"
/>

<figcaption>This figure gets a border.</figcaption>
</figure>
</div>

Size figure

View full screen
Code

Source (Nunjucks)

<div class="prose">
<p>In order for the <code>&lt;figure&gt;</code> to take up the full width of the element that it is in, add the attribute <code>data-size="full"</code>.</p>
<p>Content inside of the <code>&lt;figure&gt;</code> will stretch to take up all the available space.</p>
<figure data-size="full">
<img alt="Dog holding a stick." decoding="auto" height="240" src="https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/QlgeHQrzaD9IOKBXB68I.jpg?auto=format" width="380">
<figcaption>This figure and it's content is taking up the full space it can.</figcaption>
</figure>
</div>

Output

<div class="prose">
<p>
In order for the <code>&lt;figure&gt;</code> to take up the full width of
the element that it is in, add the attribute <code>data-size="full"</code>.
</p>
<p>
Content inside of the <code>&lt;figure&gt;</code> will stretch to take up
all the available space.
</p>
<figure data-size="full">
<img
alt="Dog holding a stick."
decoding="auto"
height="240"
src="https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/QlgeHQrzaD9IOKBXB68I.jpg?auto=format"
width="380"
/>

<figcaption>
This figure and it's content is taking up the full space it can.
</figcaption>
</figure>
</div>

We want to help you build beautiful, accessible, fast, and secure websites that work cross-browser, and for all of your users. This site is our home for content to help you on that journey, written by members of the Chrome team, and external experts.

Contribute

  • File a bug
  • View source

Related content

  • developer.chrome.com
  • Chrome updates
  • Case studies
  • Podcasts
  • Shows

Connect

  • Twitter
  • YouTube
  • Google Developers
  • Chrome
  • Firebase
  • Google Cloud Platform
  • All products
  • Terms & Privacy
  • Community Guidelines

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies.