LEGACY Tailwind CSS v3-era example, archived unchanged. Kept for reference only — it uses the v3 Play CDN and JS config, both removed in v4. Current documentation →

Tailwind CSS Filters

Learn how to apply visual effects like blur, brightness, contrast, and more to your elements using Tailwind's filter utilities.

Filter Properties

Tailwind CSS provides a comprehensive set of filter utilities that allow you to apply visual effects to your elements. These filters are particularly useful for image manipulation, creating depth effects, and enhancing visual appeal.

When to Use Filters

  • Image adjustments (brightness, contrast)
  • Blurring elements for depth effects
  • Creating monochrome or color-shifted effects

Key Benefits

  • Apply effects without image editing software
  • Dynamic effects with hover/focus states
  • Performant CSS-based visual effects

Filter Examples

Blur Filter

The blur filter applies a Gaussian blur to the element. Larger values create more intense blur effects.

blur-none

Sample image with no blur
blur-none

blur-sm

Sample image with small blur
blur-sm

blur-md

Sample image with medium blur
blur-md

blur-xl

Sample image with extra large blur
blur-xl

Brightness Filter

The brightness filter adjusts the brightness of the element. Values below 100% darken, values above 100% brighten.

brightness-50

Sample image with 50% brightness
brightness-50

brightness-100

Sample image with normal brightness
brightness-100

brightness-125

Sample image with 125% brightness
brightness-125

brightness-150

Sample image with 150% brightness
brightness-150

Contrast Filter

The contrast filter adjusts the contrast of the element. Higher values increase the difference between light and dark colors.

contrast-50

Sample image with 50% contrast
contrast-50

contrast-100

Sample image with normal contrast
contrast-100

contrast-150

Sample image with 150% contrast
contrast-150

contrast-200

Sample image with 200% contrast
contrast-200

Color Manipulation Filters

Tailwind provides several filters for color manipulation effects like grayscale, sepia, invert, and hue-rotate.

grayscale

Sample image in grayscale
grayscale

sepia

Sample image with sepia effect
sepia

invert

Sample image with inverted colors
invert

hue-rotate-180

Sample image with hue rotated 180 degrees
hue-rotate-180

Saturation Filter

The saturate filter adjusts the color saturation of an element. Higher values create more vivid, intense colors.

saturate-50

Sample image with 50% saturation
saturate-50

saturate-100

Sample image with normal saturation
saturate-100

saturate-150

Sample image with 150% saturation
saturate-150

saturate-200

Sample image with 200% saturation
saturate-200

Filter Tips

Practical Usage Examples

Real-World Filter Applications

Image Gallery Effects

Gallery image 1
Gallery image 2

Code Example:

<div class="group relative overflow-hidden">
  <img class="grayscale group-hover:grayscale-0 
  transition-all duration-300" src="image.jpg">
</div>

UI Component Enhancement

Glassmorphism Effect

Using blur filters to create modern UI effects.

Code Example:

<div class="relative">
  <div class="absolute inset-0 blur-xl bg-gradient-to-r 
  from-indigo-500 to-purple-500"></div>
  <div class="relative bg-white/80 backdrop-blur-sm">
    Content here
  </div>
</div>

Summary & Key Takeaways

What We've Learned

  • Tailwind CSS offers a wide range of filter utilities that can be applied to any element
  • Filters can be used for image manipulation, creating visual effects, and enhancing UI components
  • Multiple filters can be combined for more complex visual effects
  • Responsive and interactive effects can be created using breakpoint prefixes and hover states

Next Steps

  • Experiment with combining different filters for unique visual effects
  • Create interactive components with hover filter effects
  • Use backdrop filters for modern glassmorphism UI effects
  • Check out the official Tailwind CSS documentation for more details