Installation
Choose your framework. The registry installs the component and its runtime 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/LiquidSurface.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/LiquidSurface.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/LiquidSurface.vue and installs its dependencies.
Basic usage
The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.
Component API
Types below match the selected Svelte component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL of the image beneath the liquid layer.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Size of the centered image relative to the canvas.
- Type
number- Default
1- Range / values
0.2–1
Height of the flowing surface above the image.
- Type
number- Default
1.6- Range / values
0–3
Optical depth between the surface and the image.
- Type
number- Default
1- Range / values
0–2
Color separation caused by the curved surface.
- Type
number- Default
0.9- Range / values
0–3
Visibility of the liquid layer. Zero restores the original image.
- Type
number- Default
1- Range / values
0–1
Momentum transferred to the liquid by pointer movement.
- Type
number- Default
3- Range / values
0–3
Width of the waves left along the pointer path.
- Type
number- Default
0.085- Range / values
0.03–0.25
Rate at which the liquid loses momentum. Lower values preserve waves longer.
- Type
number- Default
2- Range / values
0–2
Propagation speed of waves through the liquid.
- Type
number- Default
0.18- Range / values
0.05–0.4
Momentum diffusion that smooths small ripples.
- Type
number- Default
1- Range / values
0–1
Number of simulation cells along the shorter side.
- Type
number- Default
192- Range / values
64–384
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Pointer movement stirs travelling waves in the glass surface. Disabling interaction stops new input; existing waves continue evolving.
- Type
boolean- Default
true- Range / values
true, 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
URL or data URL of the image beneath the liquid layer.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Size of the centered image relative to the canvas.
- Type
number- Default
1- Range / values
0.2–1
Height of the flowing surface above the image.
- Type
number- Default
1.6- Range / values
0–3
Optical depth between the surface and the image.
- Type
number- Default
1- Range / values
0–2
Color separation caused by the curved surface.
- Type
number- Default
0.9- Range / values
0–3
Visibility of the liquid layer. Zero restores the original image.
- Type
number- Default
1- Range / values
0–1
Momentum transferred to the liquid by pointer movement.
- Type
number- Default
3- Range / values
0–3
Width of the waves left along the pointer path.
- Type
number- Default
0.085- Range / values
0.03–0.25
Rate at which the liquid loses momentum. Lower values preserve waves longer.
- Type
number- Default
2- Range / values
0–2
Propagation speed of waves through the liquid.
- Type
number- Default
0.18- Range / values
0.05–0.4
Momentum diffusion that smooths small ripples.
- Type
number- Default
1- Range / values
0–1
Number of simulation cells along the shorter side.
- Type
number- Default
192- Range / values
64–384
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Pointer movement stirs travelling waves in the glass surface. Disabling interaction stops new input; existing waves continue evolving.
- Type
boolean- Default
true- Range / values
true, 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
LiquidSurfaceHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL of the image beneath the liquid layer.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Size of the centered image relative to the canvas.
- Type
number- Default
1- Range / values
0.2–1
Height of the flowing surface above the image.
- Type
number- Default
1.6- Range / values
0–3
Optical depth between the surface and the image.
- Type
number- Default
1- Range / values
0–2
Color separation caused by the curved surface.
- Type
number- Default
0.9- Range / values
0–3
Visibility of the liquid layer. Zero restores the original image.
- Type
number- Default
1- Range / values
0–1
Momentum transferred to the liquid by pointer movement.
- Type
number- Default
3- Range / values
0–3
Width of the waves left along the pointer path.
- Type
number- Default
0.085- Range / values
0.03–0.25
Rate at which the liquid loses momentum. Lower values preserve waves longer.
- Type
number- Default
2- Range / values
0–2
Propagation speed of waves through the liquid.
- Type
number- Default
0.18- Range / values
0.05–0.4
Momentum diffusion that smooths small ripples.
- Type
number- Default
1- Range / values
0–1
Number of simulation cells along the shorter side.
- Type
number- Default
192- Range / values
64–384
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Pointer movement stirs travelling waves in the glass surface. Disabling interaction stops new input; existing waves continue evolving.
- Type
boolean- Default
true- Range / values
true, 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