Filter
CSS filters allow you to visually manipulate an element by changing pixels' colors, blurring, brightening, or darkening images, among other effects. Here are the commonly used filter functions:
blur()
: Applies a Gaussian blur to the image. The parameter is the radius of the blur.brightness()
: Adjusts the brightness of the input. A value of 0% will create an image that is completely black. A value of 100% leaves the input unchanged.contrast()
: Adjusts the contrast of the input. A value of 0% will create an image that is completely black. A value of 100% leaves the input unchanged.grayscale()
: Converts the input image to grayscale. A value of 100% is completely grayscale. A value of 0% leaves the input unchanged.hue-rotate()
: Applies a hue rotation on the image. The value defines the number of degrees around the color circle the input samples will be adjusted.invert()
: Inverts the samples in the input image.opacity()
: Applies transparency to the input image. A value of 0% is completely transparent. A value of 100% leaves the input unchanged.saturate()
: Saturates the input image. A value of 0% is completely un-saturated. A value of 100% leaves the input unchanged.sepia()
: Converts the input image to sepia. A value of 100% is completely sepia. A value of 0% leaves the input unchanged.Remember, the ease of using CSS with Chakra UI's style props allows you to create and customize as many filter effects as you need. You can create reusable components with these effects to make your development process smoother and your user interface more engaging.
Here is how you can apply these CSS filters to an image using Chakra UI:
Examples
Filtered Images
Filtered Images as Backdrops
🚨 backdrop-filter is not compatible with Firefox. Although users have the option to enable it, it is advisable to create a component that appears visually appealing both with and without utilizing this property.
Did you know?
Creative Idea No. 1
Code
Creative Idea No. 2
Code
Creative Idea No. 3
Code
copyright © 2023 IHeartComponents | evanmarie.com
created with love by the I♥️Components team using
Special thanks to Stefan Bohacek / Generative Placeholders.