Installation
Choose your framework. The registry installs one component file and its PixiJS dependency.
Installation unavailable
The preview is public, but its installable release is still being prepared.
The registry command writes the component to src/lib/components/ui/LiquidMetal.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/LiquidMetal.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/LiquidMetal.vue and installs its dependencies.
PixiJS is included as a registry dependency and is installed by the same command.
The generated component contains both WGSL and GLSL so WebGPU can fall back to WebGL.
Overview
Liquid Metal turns layered procedural distortion into a reflective surface that feels fluid without relying on textures or external assets.
It works best as a visual layer inside a deliberately sized container: a hero background, campaign surface, transition, or immersive product section.
Basic usage
The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.
- Give the component or its parent an explicit height; the shader always fills that parent and never claims the viewport itself.
- Place readable foreground content in a later stacking layer and keep contrast independent from the brightest part of the animation.
Component API
Types below match the selected Svelte component.
Additional classes for the parent-sized root element.
- Type
string
Light color reflected through the liquid-metal surface.
- Type
string- Default
"#FFFFFF"
Dark color reflected through the liquid-metal surface.
- Type
string- Default
"#17181A"
Animation speed multiplier. Set to zero for a still frame.
- Type
number- Default
1- Range / values
0–2
Scale multiplier for the distorted field.
- Type
number- Default
1- Range / values
0.35–2.5
Spatial frequency of the distorted folds.
- Type
number- Default
3.5- Range / values
1–8
Strength of the liquid-metal lens displacement.
- Type
number- Default
2- Range / values
0–5
Strength of RGB separation inside the refracted surface.
- Type
number- Default
3- Range / values
0–8
Radius multiplier for the internal nine-sample blur.
- Type
number- Default
1- Range / values
0–2.5
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy
Types below match the selected React component.
Additional classes for the parent-sized root element.
- Type
string
Light color reflected through the liquid-metal surface.
- Type
string- Default
"#FFFFFF"
Dark color reflected through the liquid-metal surface.
- Type
string- Default
"#17181A"
Animation speed multiplier. Set to zero for a still frame.
- Type
number- Default
1- Range / values
0–2
Scale multiplier for the distorted field.
- Type
number- Default
1- Range / values
0.35–2.5
Spatial frequency of the distorted folds.
- Type
number- Default
3.5- Range / values
1–8
Strength of the liquid-metal lens displacement.
- Type
number- Default
2- Range / values
0–5
Strength of RGB separation inside the refracted surface.
- Type
number- Default
3- Range / values
0–8
Radius multiplier for the internal nine-sample blur.
- Type
number- Default
1- Range / values
0–2.5
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
LiquidMetalHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
Light color reflected through the liquid-metal surface.
- Type
string- Default
"#FFFFFF"
Dark color reflected through the liquid-metal surface.
- Type
string- Default
"#17181A"
Animation speed multiplier. Set to zero for a still frame.
- Type
number- Default
1- Range / values
0–2
Scale multiplier for the distorted field.
- Type
number- Default
1- Range / values
0.35–2.5
Spatial frequency of the distorted folds.
- Type
number- Default
3.5- Range / values
1–8
Strength of the liquid-metal lens displacement.
- Type
number- Default
2- Range / values
0–5
Strength of RGB separation inside the refracted surface.
- Type
number- Default
3- Range / values
0–8
Radius multiplier for the internal nine-sample blur.
- Type
number- Default
1- Range / values
0–2.5
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy