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/Caustics.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/Caustics.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/Caustics.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
Speed of the moving light pattern. Set to zero for a still frame.
- Type
number- Default
1- Range / values
0–3
Size of the caustic shapes. Higher values make the shapes larger.
- Type
number- Default
1- Range / values
0.25–4
Strength of the bends and folds within the light pattern.
- Type
number- Default
0.5- Range / values
0–1
Brightness of the caustic light before grain and edge shading.
- Type
number- Default
1- Range / values
0–3
Color of the caustic light.
- Type
string- Default
"#FFFFFF"
Color beneath the light and around the shaded edges.
- Type
string- Default
"#16171D"
Strength of the dusty texture and scattered pigment.
- Type
number- Default
0.25- Range / values
0–1
Size of the coarse grain in CSS pixels, independent of the pattern.
- Type
number- Default
0.5- Range / values
0.5–4
Strength of the shading around the light field.
- Type
number- Default
1- Range / values
0–1
Size of the area left visible by the edge shading.
- Type
number- Default
0.544- Range / values
0.1–1.5
Width of the transition into the shaded edges.
- Type
number- Default
1- Range / values
0.05–2
Horizontal center of the visible area, from left to right.
- Type
number- Default
0.4503301753430868- Range / values
0–1
Vertical center of the visible area, from top to bottom.
- Type
number- Default
0.5529100615226321- Range / values
0–1
Angle of the visible ellipse in degrees.
- Type
number- Default
52.488- Range / values
-180–180
Balance between the horizontal and vertical compression of the visible area.
- Type
number- Default
0.38- Range / values
0.1–0.9
Amount by which local brightness shifts the shaded boundary.
- Type
number- Default
0.3- Range / values
0–1
Stops the render loop while keeping the current frame visible.
- 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
Speed of the moving light pattern. Set to zero for a still frame.
- Type
number- Default
1- Range / values
0–3
Size of the caustic shapes. Higher values make the shapes larger.
- Type
number- Default
1- Range / values
0.25–4
Strength of the bends and folds within the light pattern.
- Type
number- Default
0.5- Range / values
0–1
Brightness of the caustic light before grain and edge shading.
- Type
number- Default
1- Range / values
0–3
Color of the caustic light.
- Type
string- Default
"#FFFFFF"
Color beneath the light and around the shaded edges.
- Type
string- Default
"#16171D"
Strength of the dusty texture and scattered pigment.
- Type
number- Default
0.25- Range / values
0–1
Size of the coarse grain in CSS pixels, independent of the pattern.
- Type
number- Default
0.5- Range / values
0.5–4
Strength of the shading around the light field.
- Type
number- Default
1- Range / values
0–1
Size of the area left visible by the edge shading.
- Type
number- Default
0.544- Range / values
0.1–1.5
Width of the transition into the shaded edges.
- Type
number- Default
1- Range / values
0.05–2
Horizontal center of the visible area, from left to right.
- Type
number- Default
0.4503301753430868- Range / values
0–1
Vertical center of the visible area, from top to bottom.
- Type
number- Default
0.5529100615226321- Range / values
0–1
Angle of the visible ellipse in degrees.
- Type
number- Default
52.488- Range / values
-180–180
Balance between the horizontal and vertical compression of the visible area.
- Type
number- Default
0.38- Range / values
0.1–0.9
Amount by which local brightness shifts the shaded boundary.
- Type
number- Default
0.3- Range / values
0–1
Stops the render loop while keeping the current frame visible.
- 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
CausticsHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
Speed of the moving light pattern. Set to zero for a still frame.
- Type
number- Default
1- Range / values
0–3
Size of the caustic shapes. Higher values make the shapes larger.
- Type
number- Default
1- Range / values
0.25–4
Strength of the bends and folds within the light pattern.
- Type
number- Default
0.5- Range / values
0–1
Brightness of the caustic light before grain and edge shading.
- Type
number- Default
1- Range / values
0–3
Color of the caustic light.
- Type
string- Default
"#FFFFFF"
Color beneath the light and around the shaded edges.
- Type
string- Default
"#16171D"
Strength of the dusty texture and scattered pigment.
- Type
number- Default
0.25- Range / values
0–1
Size of the coarse grain in CSS pixels, independent of the pattern.
- Type
number- Default
0.5- Range / values
0.5–4
Strength of the shading around the light field.
- Type
number- Default
1- Range / values
0–1
Size of the area left visible by the edge shading.
- Type
number- Default
0.544- Range / values
0.1–1.5
Width of the transition into the shaded edges.
- Type
number- Default
1- Range / values
0.05–2
Horizontal center of the visible area, from left to right.
- Type
number- Default
0.4503301753430868- Range / values
0–1
Vertical center of the visible area, from top to bottom.
- Type
number- Default
0.5529100615226321- Range / values
0–1
Angle of the visible ellipse in degrees.
- Type
number- Default
52.488- Range / values
-180–180
Balance between the horizontal and vertical compression of the visible area.
- Type
number- Default
0.38- Range / values
0.1–0.9
Amount by which local brightness shifts the shaded boundary.
- Type
number- Default
0.3- Range / values
0–1
Stops the render loop while keeping the current frame visible.
- 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