{% set image %}
{% include '@bolt-elements-image/image.twig' with {
attributes: {
alt: 'Alt text.',
src: 'https://via.placeholder.com/400x300',
width: 400,
height: 300,
},
} only %}
{% endset %}
{% include '@bolt-elements-ratio/ratio.twig' with {
content: image,
ratio: 'wide',
} only %}
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal-style attributes object with extra attributes to append to this element. |
object
| — |
|
content
|
A nested element with proportions defined through ratio property. It can be for example image or video. |
any
| — |
|
ratio
|
An aspect ratio between the width and height. Expressed as width divided by height. You can choose from: standard(4/3), square(1/1), wide(16/9). Custom aspect ratio can be set via the CSS custom property |
string
|
standard
|
|
npm install @bolt/elements-ratio