Retlif is a React library for SVG filters.
It’s small & powerful for
simple reusable filters like <Blur>this</Blur> ☞
or complex filters like <Pixelate>this</Pixelate> ☞
Filters are composable:
<BlurX>
<Blue>Hello!</Blue>
</BlurX>
☞ Hello!
Filters can be applied to any elements:
<Twist>
<marquee><input/></marquee>
</Twist>
☞
Filters are defined as JavaScript functions:
import retlif, { displace*, turbulence* } from 'retlif'
const effect1 = turbulence({ baseFrequency: 0.01, numOctaves: 2, seed: 1, stitchTiles: 'stitch' })
const effect2 = displace({ scale: 30 })
const MyFilter = retlif()(effect2('SourceGraphic', effect1))
☞ <MyFilter>...</MyFilter>
Examples
Feel free to contribute more examples.
Retlif is made for fun. Not recommended for production use due to capability and performance issues.
Install it via yarn add retlif
.