Liquid Metal
Free
Covers a logo in animated liquid metal with flowing stripes, color dispersion, and distortion along the edges. Adapted from Liquid Metal by Paper Shaders (shaders.paper.design) under the Apache 2.0 license.
Code
Usage
<ShaderLiquidMetal
backgroundColor="#aaaaac"
tintColor="#ffffff"
logoSrc="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='465' height='427' viewBox='21 28 465 427'%3E %3Cpath fill='%23000' d='M274 38 318 171h-25l-19-52-18 52h-26z'/%3E %3Cpath fill='%23000' d='m356 286 43 137-116-84 21-16 41 31-11-53z'/%3E %3Cpath fill='%23000' d='M31 185h445L115 445l234-217z'/%3E%3C/svg%3E"
blueShift={0.3}
contourDistortion={0.4}
stripeDistortion={0.07}
flowAngle={70}
redShift={0.3}
stripeSoftness={0.1}
stripeDensity={2}
metalSpeed={1}
graphicScale={0.6}
graphicRotation={0}
graphicOffsetX={0}
graphicOffsetY={0}
/>Props
| prop | type | default | description |
|---|---|---|---|
logoSrc | string | "" | Logo URL. Use an SVG or PNG with a transparent background. The URL must be same-origin or served with CORS headers. |
logoLabel | string | "" | Accessible name for the logo. Leave it empty when the effect is decorative. |
shape | "none" | "circle" | "daisy" | "diamond" | "metaballs" | diamond | Built-in shape to draw when logoSrc is empty. |
backgroundColor | string | #aaaaac | Color behind the logo. Accepts any CSS color. |
tintColor | string | #ffffff | Color burned into the metal. Accepts any CSS color. |
stripeDensity | number | 2 | Number of stripes in the metal pattern. Range 1 to 10. |
stripeSoftness | number | 0.1 | At 0 the stripes have hard edges. At 1 they blend smoothly. Range 0 to 1. |
redShift | number | 0.3 | Dispersion of the red channel. Range -1 to 1. |
blueShift | number | 0.3 | Dispersion of the blue channel. Range -1 to 1. |
stripeDistortion | number | 0.07 | Noise distortion of the stripes. Range 0 to 1. |
contourDistortion | number | 0.4 | Strength of the distortion along the logo edges. Range 0 to 1. |
flowAngle | number | 70 | Direction of the stripe motion in degrees. Range 0 to 360. |
metalSpeed | number | 1 | Animation speed. 0 stops the animation. Range 0 to 2. |
graphicScale | number | 0.6 | Overall zoom level of the graphic. |
graphicRotation | number | 0 | Rotation of the graphic in degrees. |
graphicOffsetX | number | 0 | Horizontal offset of the graphic center. |
graphicOffsetY | number | 0 | Vertical offset of the graphic center. |
graphicFit | "none" | "contain" | "cover" | contain | How the graphic fits the box. |
opacity | number | 1 | Sets the opacity of the whole block. |
maxDpr | number | 1.5 | Caps device pixel ratio for sharper output without runaway GPU cost. |
maxFps | 30 | 45 | 60 | 60 | Caps the animation frame rate for performance-sensitive pages. |