{% set image %}
{% include '@bolt-elements-image/image.twig' with {
attributes: {
src: '/images/placeholders/500x500.jpg',
loading: 'lazy',
}
} only %}
{% endset %}
{% include '@bolt-components-figure/figure.twig' with {
media: {
content: image
},
caption: 'Figure caption.'
} only %}
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal-style attributes object with extra attributes to append to this component. |
object
| — |
|
media
|
Pass in any renderable media content via the |
object
| — |
|
caption
|
Caption for the figure. |
string
, object
, array
|
— |
|
npm install @bolt/components-figure
Column 1 | Column 2 | Column 3 | |
---|---|---|---|
Row 1 | R1C1 | R1C2 | R1C3 |
Row 2 | R2C1 | R2C2 | R2C3 |
Row 3 | R3C1 | R3C2 | R3C3 |
Footer | FC1 | FC2 | FC3 |
<bolt-figure>
to wrap your figure media and caption. The figure media must have the attribute slot="media"
or be wrapped by an element with that attribute. Everything else inside the <bolt-figure>
tag is considered the caption. We recommend simply using text with optional inline markup (as seen below).
<bolt-figure>
<bolt-image src="/images/placeholders/landscape-16x9-mountains.jpg" slot="media"></bolt-image>
This is a caption. Lorem ipsum <em>dolor sit amet</em>, consectetur adipiscing elit <a href="#">text link</a>.
</bolt-figure>