{% set image %}
{% include '@bolt-elements-image/image.twig' with {
background: true,
attributes: {
src: '/images/placeholders/backgrounds/background-light-tall.jpg',
srcset: '/images/placeholders/backgrounds/background-light-tall-640.jpg 640w, /images/placeholders/backgrounds/background-light-tall-1024.jpg 1024w, /images/placeholders/backgrounds/background-light-tall-1920.jpg 1920w',
width: 3840,
height: 2160,
},
} only %}
{% endset %}
<div style="height: 400px; position: relative;" class="t-bolt-black">
{% include '@bolt-components-background/background.twig' with {
fill: 'gradient',
items: [
image,
]
} only %}
</div>
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
attributes
|
A Drupal-style attributes object with extra attributes to append to this component. |
object
| — |
|
opacity
|
Overlay opacity |
string
|
none
|
|
fill
|
Type of fill to use for the overlay. |
string
|
solid
|
|
focal_point
|
Point where the background gradient highlight should originate. |
object
| — |
|
video
|
Set to true if you like to use video as a background. |
boolean
|
false
|
|
items
|
An array of renderable items to place in the background. |
array
| — |
|
shape_group
|
Add a Bolt Background Shapes group. |
string
|
none
|
|
shape_alignment
|
Alignment of shape group. |
string
|
right
|
|
npm install @bolt/components-background
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
{% include '@bolt-components-background/background.twig' with {
opacity: 'medium',
items: [
image
]
} only %}
valign
options.
attributes
prop with the a CSS var. Please refer to the fit and position documentation for more information.Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
{% set image %}
{% include '@bolt-elements-image/image.twig' with {
background: true,
attributes: {
src: '/images/placeholders/backgrounds/background-light-tall.jpg',
srcset: '/images/placeholders/backgrounds/background-light-tall-640.jpg 640w, /images/placeholders/backgrounds/background-light-tall-1024.jpg 1024w, /images/placeholders/backgrounds/background-light-tall-1920.jpg 1920w',
width: 4320,
height: 2880,
style: '--e-bolt-image-position: center center;',
},
} only %}
{% endset %}
{% include '@bolt-components-background/background.twig' with {
opacity: 'medium',
items: [
image
]
} only %}
video
boolean prop to true
when you want to render a background video.controls
attribute is not present. In addition, make sure the following attributes are present on the video element; autoplay
, loop
, and muted
.Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
{% set background_video %}
{% include '@bolt-elements-image/image.twig' with {
attributes: {
src: '/images/placeholders/backgrounds/background-light-tall.jpg',
background: true,
loading: 'lazy',
}
} only %}
{% set video %}
<video-js
data-account="1900410236"
data-player="O3FkeBiaDz"
data-embed="default"
data-video-id="5999324539001"
autoplay loop muted
class="c-base-video"></video-js>
{% endset %}
{% include '@bolt-elements-ratio/ratio.twig' with {
content: video,
ratio: 'wide'
} only %}
{% endset %}
{% include './_00-background-band-demo.twig' with {
background: {
fill: 'solid',
video: true,
opacity: 'heavy',
items: [
background_video,
]
}
} only %}
shape_group
and shape_alignemnt
props are deprecated and are no longer supported. Please don't use them.Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
{% include '@bolt-components-background/background.twig' with {
shape_group: 'A',
shape_alignment: 'left'
} only %}
theme
prop. Theme is instead determined by a t-bolt-*
class on the nearest parent element.t-bolt-*
class to the background itself, but rather a parent element that is also a parent of any overlaid text.full
. Use the focal_point
prop, text positioning, and good judgment in these scenarios.All themes are supported. A few examples are shown below.
This background has a solid
fill and the surrounding theme is t-bolt-white
This background has a solid
fill and the surrounding theme is t-bolt-black
This background has a solid
fill and the surrounding theme is t-bolt-navy-dark
<div class="t-bolt-navy-dark">
{% include '@bolt-components-background/background.twig' with {
fill: 'solid',
} only %}
</div>
focal_point
sets the horizontal and vertical alignment of the gradient (if applicable).
gradient
fill and the focal point is set to horiztonal: left
and vertical: top
gradient
fill and the focal point is set to horiztonal: left
and vertical: bottom
{% include '@bolt-components-background/background.twig' with {
fill: 'gradient',
focal_point: {
vertical: 'top',
horizontal: 'left',
},
} only %}
solid
and gradient
fill options.
fill
prop consider using an opacity
prop as well. For more information on the opacity
prop, reference the Background Opacity documentation.Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
{% set image %}
{% include '@bolt-elements-image/image.twig' with {
background: true,
attributes: {
src: '/images/placeholders/backgrounds/background-light-tall.jpg',
srcset: '/images/placeholders/backgrounds/background-light-tall-640.jpg 640w, /images/placeholders/backgrounds/background-light-tall-1024.jpg 1024w, /images/placeholders/backgrounds/background-light-tall-1920.jpg 1920w',
width: 4320,
height: 2880
},
} only %}
{% endset %}
{% include '@bolt-components-background/background.twig' with {
fill: 'solid',
opacity: 'medium',
items: [
image
]
} only %}
opacity: none
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
opacity: light
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
opacity: medium
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
opacity: heavy
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
opacity: full
Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
{% include '@bolt-components-background/background.twig' with {
opacity: 'medium',
items: [
image
]
} only %}
loading
set to eager
.Continuously improve results by visualizing how future adjustments to your strategies can impact business performance. Simulate and test your ideas, evaluate the results using intuitive views, and then deploy optimal alterations.
{% set image %}
{% include '@bolt-elements-image/image.twig' with {
background: true,
attributes: {
src: '/images/placeholders/backgrounds/background-light-tall.jpg',
loading: 'eager'
},
} only %}
{% endset %}
{% include '@bolt-components-background/background.twig' with {
opacity: 'heavy',
fill: 'gradient',
focal_point: {
horizontal: 'right',
vertical: 'top',
},
items: [
image,
]
} only %}