You are viewing the archived Skeleton v4.0 documentation.

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.

svelte
<!-- The Target Element -->
<img style="filter: url(#Apollo)" />

<!-- Via arbitrary Tailwind syntax -->
<Avatar classes="[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.

Apollo filter #Apollo
BlueNight filter #BlueNight
Emerald filter #Emerald
GreenFall filter #GreenFall
Noir filter #Noir
NoirLight filter #NoirLight
Rustic filter #Rustic
Summer84 filter #Summer84
XPro filter #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 within 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}.
View page on GitHub