Utilities for applying backdrop blur filters to an element.
Use the backdrop-blur-{amount?}
utilities alongside the backdrop-filter
utility to control an element’s backdrop blur.
<div class="backdrop-filter backdrop-blur-lg ...">
<!-- ... -->
</div>
To control an element’s backdrop blur at a specific breakpoint, add a {screen}:
prefix to any existing backdrop blur utility. For example, use md:backdrop-blur-lg
to apply the backdrop-blur-lg
utility at only medium screen sizes and above.
<div class="backdrop-filter backdrop-blur-sm md:backdrop-blur-lg ...">
<!-- ... -->
</div>
For more information about Tailwind’s responsive design features, check out the Responsive Design documentation.
You can customize which backdrop-blur
utilities are generated using the backdropBlur
key in the theme
section of your tailwind.config.js
file.
// tailwind.config.js
module.exports = {
theme: {
+ extend: {
+ backdropBlur: {
+ xs: '2px',
+ }
+ }
}
}
Learn more about customizing the default theme in the theme customization documentation.
By default, only responsive variants are generated for backdrop blur utilities.
You can control which variants are generated for the backdrop blur utilities by modifying the backdropBlur
property in the variants
section of your tailwind.config.js
file.
For example, this config will also generate hover and focus variants:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
+ backdropBlur: ['hover', 'focus'],
}
}
}
If you don't plan to use the backdrop blur utilities in your project, you can disable them entirely by setting the backdropBlur
property to false
in the corePlugins
section of your config file:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
+ backdropBlur: false,
}
}