Skip to content

Figure

Semantic container for images with captions. Uses HTML5 <figure> and <figcaption>.

When to use

  • Images that need a descriptive caption
  • Charts, diagrams, or illustrations with explanatory text
  • Any visual content that benefits from attribution or context

When not to use

  • Standalone images without captions — just use <img> with Image utilities
  • Image galleries — use Carousel or a grid layout

Default

End-aligned caption


CSS classes

ClassDescription
.figureContainer — display: inline-flex; flex-direction: column
.figure__imgImage — block display, responsive, rounded
.figure__captionCaption text — small, tertiary color
.figure--centerCenters the figure horizontally
.figure--endRight-aligns the caption text

Accessibility

  • <figure> provides implicit grouping for assistive technology
  • <figcaption> is automatically associated with the figure
  • Still provide alt text on the <img> — the caption supplements, not replaces