1. resources
  2. cookbook
  3. svg filters

SVG Filters

Apply filter effects to elements and images.

How It Works

This feature is enabled by SVG filters paired with feColorMatrix transformations.

Usage

Apply a filter to any element using the Filter style property and passing the unique SVG Filter ID.

<!-- The Target Element -->
<img ... style="filter: url(#Apollo)" />
<!-- The SVG Filter with a matching unique ID -->
<svg><filter id="Apollo">...</filter></svg>

We’ve provided a curated collection of SVG Filters to choose from below.

full-0 #Apollo
full-1 #BlueNight
full-2 #Emerald
full-3 #GreenFall
full-4 #Noir
full-5 #NoirLight
full-6 #Rustic
full-7 #Summer
full-8 #XPro

Create a Filter

We recommend SVG Color Matrix Mixer by Rik Schennink to create your own filters.

Tips

  • The SVG must be in the same scope as the elements you wish to filter. Global scope is acceptable.
  • Consder storing your SVGs witin your local project for quick and reusable imports.
  • All Vite-based frameworks support SVG imports.
  • Optionally you can embed the SVG within a imported component (ex: Apollo.svelte, Apollo.tsx).
  • Filter SVGs are affected by the flow DOM, including class styles such as space-{x|y}.