Water
Installation
npm i @paper-design/shaders-react
Code
import { Water } from '@paper-design/shaders-react';
<Water>
<div className="demo">
<style>{`.demo { display: grid; align-content: center; justify-items: start; gap: 40px; height: 100%; padding: 0 8% }
.demo p { margin: 0; font: 700 120px/1 system-ui; background: linear-gradient(90deg, #4052d6, #9b5de5); background-clip: text; color: transparent }
.demo button { padding: 32px 64px; border: 0; border-radius: 99px; font: 48px system-ui; color: #fff; background: linear-gradient(135deg, #4052d6, #9b5de5) }
.demo button:hover { filter: brightness(1.15) }`}</style>
<p>Select this text</p>
<button
onClick={(event) => {
const clicks = Number(event.currentTarget.dataset.clicks ?? 0) + 1;
event.currentTarget.dataset.clicks = String(clicks);
event.currentTarget.textContent = `Clicked ${clicks} time${clicks === 1 ? '' : 's'}`;
}}
>
Hover and click me
</button>
</div>
</Water>
Shader Props
Common Props
Description
Water-like surface distortion with natural caustic realism. Works as an image filter or standalone animated texture.
Notes
Thanks to zozuar for the amazing recursive fractal noise algorithm.