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/GlassDrift.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/GlassDrift.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/GlassDrift.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
Detail level of the fluid motion along the shorter edge.
- Type
number- Default
128- Range / values
32–256
Detail level of the color field along the shorter edge.
- Type
number- Default
512- Range / values
128–1024
How quickly injected color fades from the fluid.
- Type
number- Default
0.7- Range / values
0–4
How quickly the fluid motion loses momentum.
- Type
number- Default
1.2- Range / values
0–4
Amount of pressure retained between simulation steps.
- Type
number- Default
0.8- Range / values
0–1
Number of pressure passes used to preserve fluid volume. Higher values improve accuracy and cost more to render.
- Type
number- Default
8- Range / values
1–40
Strength of the small rolling eddies in the fluid.
- Type
number- Default
3- Range / values
0–50
Width of the fluid affected by pointer movement.
- Type
number- Default
1- Range / values
0.01–4
Momentum added to the fluid by pointer movement.
- Type
number- Default
2500- Range / values
0–10000
Angle of the panes in degrees.
- Type
number- Default
-30- Range / values
-180–180
Width of each repeating pane.
- Type
number- Default
1.6- Range / values
0.2–2.5
Strength of image displacement.
- Type
number- Default
1- Range / values
0–3
Separation of red and blue along the refracted direction.
- Type
number- Default
0.35- Range / values
0–3
Speed of the automatic currents and color cycle. Zero leaves only pointer-driven fluid.
- Type
number- Default
0.65- Range / values
0–2
First dye color in the continuous color cycle.
- Type
string- Default
"#57BDE3"
Second dye color in the continuous color cycle.
- Type
string- Default
"#FF1F04"
Surface color visible through the unpainted glass.
- Type
string- Default
"#FFFFFF"
Color of the panel edges and soft reflections.
- Type
string- Default
"#C5C8D2"
Visibility of the simulated dye beneath the glass.
- Type
number- Default
2.5- Range / values
0–6
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Adds dye and momentum along pointer gestures. Automatic color flow continues when interaction is disabled.
- 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
Detail level of the fluid motion along the shorter edge.
- Type
number- Default
128- Range / values
32–256
Detail level of the color field along the shorter edge.
- Type
number- Default
512- Range / values
128–1024
How quickly injected color fades from the fluid.
- Type
number- Default
0.7- Range / values
0–4
How quickly the fluid motion loses momentum.
- Type
number- Default
1.2- Range / values
0–4
Amount of pressure retained between simulation steps.
- Type
number- Default
0.8- Range / values
0–1
Number of pressure passes used to preserve fluid volume. Higher values improve accuracy and cost more to render.
- Type
number- Default
8- Range / values
1–40
Strength of the small rolling eddies in the fluid.
- Type
number- Default
3- Range / values
0–50
Width of the fluid affected by pointer movement.
- Type
number- Default
1- Range / values
0.01–4
Momentum added to the fluid by pointer movement.
- Type
number- Default
2500- Range / values
0–10000
Angle of the panes in degrees.
- Type
number- Default
-30- Range / values
-180–180
Width of each repeating pane.
- Type
number- Default
1.6- Range / values
0.2–2.5
Strength of image displacement.
- Type
number- Default
1- Range / values
0–3
Separation of red and blue along the refracted direction.
- Type
number- Default
0.35- Range / values
0–3
Speed of the automatic currents and color cycle. Zero leaves only pointer-driven fluid.
- Type
number- Default
0.65- Range / values
0–2
First dye color in the continuous color cycle.
- Type
string- Default
"#57BDE3"
Second dye color in the continuous color cycle.
- Type
string- Default
"#FF1F04"
Surface color visible through the unpainted glass.
- Type
string- Default
"#FFFFFF"
Color of the panel edges and soft reflections.
- Type
string- Default
"#C5C8D2"
Visibility of the simulated dye beneath the glass.
- Type
number- Default
2.5- Range / values
0–6
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Adds dye and momentum along pointer gestures. Automatic color flow continues when interaction is disabled.
- 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
GlassDriftHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
Detail level of the fluid motion along the shorter edge.
- Type
number- Default
128- Range / values
32–256
Detail level of the color field along the shorter edge.
- Type
number- Default
512- Range / values
128–1024
How quickly injected color fades from the fluid.
- Type
number- Default
0.7- Range / values
0–4
How quickly the fluid motion loses momentum.
- Type
number- Default
1.2- Range / values
0–4
Amount of pressure retained between simulation steps.
- Type
number- Default
0.8- Range / values
0–1
Number of pressure passes used to preserve fluid volume. Higher values improve accuracy and cost more to render.
- Type
number- Default
8- Range / values
1–40
Strength of the small rolling eddies in the fluid.
- Type
number- Default
3- Range / values
0–50
Width of the fluid affected by pointer movement.
- Type
number- Default
1- Range / values
0.01–4
Momentum added to the fluid by pointer movement.
- Type
number- Default
2500- Range / values
0–10000
Angle of the panes in degrees.
- Type
number- Default
-30- Range / values
-180–180
Width of each repeating pane.
- Type
number- Default
1.6- Range / values
0.2–2.5
Strength of image displacement.
- Type
number- Default
1- Range / values
0–3
Separation of red and blue along the refracted direction.
- Type
number- Default
0.35- Range / values
0–3
Speed of the automatic currents and color cycle. Zero leaves only pointer-driven fluid.
- Type
number- Default
0.65- Range / values
0–2
First dye color in the continuous color cycle.
- Type
string- Default
"#57BDE3"
Second dye color in the continuous color cycle.
- Type
string- Default
"#FF1F04"
Surface color visible through the unpainted glass.
- Type
string- Default
"#FFFFFF"
Color of the panel edges and soft reflections.
- Type
string- Default
"#C5C8D2"
Visibility of the simulated dye beneath the glass.
- Type
number- Default
2.5- Range / values
0–6
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Adds dye and momentum along pointer gestures. Automatic color flow continues when interaction is disabled.
- 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