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/DarkCurrent.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/DarkCurrent.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/DarkCurrent.vue and installs its dependencies.
Overview
Dark Current layers a recursive animated height function, estimates its surface normal, and shades the result with directional light.
Four palette stops separate recessed areas, the field body, raised color, and focused reflections.
Basic usage
The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.
- Keep Distortion below 1 for broad connected forms. Higher values break the surface into smaller turbulent structures.
- Detail changes frequency growth across all five field layers and can alter the composition substantially.
- Set Speed to zero for a static frame. Reduced-motion mode pauses the renderer automatically.
Component API
Types below match the selected Svelte component.
Additional classes for the parent-sized root element.
- Type
string
Darkest color in the recessed parts of the field.
- Type
string- Default
"#131315"
Intermediate color across the main body of the field.
- Type
string- Default
"#29305F"
Color added to raised areas of the field.
- Type
string- Default
"#5867D3"
Color of the focused reflection from the virtual light.
- Type
string- Default
"#EEF0FF"
Animation speed of the evolving field.
- Type
number- Default
0.6- Range / values
0–3
Visible scale of the procedural field.
- Type
number- Default
1- Range / values
0.2–4
Strength of the recursive directional displacement.
- Type
number- Default
3- Range / values
0–3
Frequency growth applied between field layers.
- Type
number- Default
1.5- Range / values
1.1–1.9
Intensity of colored peaks and specular reflections.
- Type
number- Default
1.6- Range / values
0–3
Horizontal direction of the virtual light in degrees.
- Type
number- Default
58- Range / values
0–360
Height of the virtual light above the field in degrees.
- Type
number- Default
60- Range / values
0–90
Focus of the specular reflection across the field.
- Type
number- Default
60- Range / values
2–80
Darkening applied toward the outer edges.
- Type
number- Default
1- Range / values
0–1
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
Darkest color in the recessed parts of the field.
- Type
string- Default
"#131315"
Intermediate color across the main body of the field.
- Type
string- Default
"#29305F"
Color added to raised areas of the field.
- Type
string- Default
"#5867D3"
Color of the focused reflection from the virtual light.
- Type
string- Default
"#EEF0FF"
Animation speed of the evolving field.
- Type
number- Default
0.6- Range / values
0–3
Visible scale of the procedural field.
- Type
number- Default
1- Range / values
0.2–4
Strength of the recursive directional displacement.
- Type
number- Default
3- Range / values
0–3
Frequency growth applied between field layers.
- Type
number- Default
1.5- Range / values
1.1–1.9
Intensity of colored peaks and specular reflections.
- Type
number- Default
1.6- Range / values
0–3
Horizontal direction of the virtual light in degrees.
- Type
number- Default
58- Range / values
0–360
Height of the virtual light above the field in degrees.
- Type
number- Default
60- Range / values
0–90
Focus of the specular reflection across the field.
- Type
number- Default
60- Range / values
2–80
Darkening applied toward the outer edges.
- Type
number- Default
1- Range / values
0–1
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
DarkCurrentHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
Darkest color in the recessed parts of the field.
- Type
string- Default
"#131315"
Intermediate color across the main body of the field.
- Type
string- Default
"#29305F"
Color added to raised areas of the field.
- Type
string- Default
"#5867D3"
Color of the focused reflection from the virtual light.
- Type
string- Default
"#EEF0FF"
Animation speed of the evolving field.
- Type
number- Default
0.6- Range / values
0–3
Visible scale of the procedural field.
- Type
number- Default
1- Range / values
0.2–4
Strength of the recursive directional displacement.
- Type
number- Default
3- Range / values
0–3
Frequency growth applied between field layers.
- Type
number- Default
1.5- Range / values
1.1–1.9
Intensity of colored peaks and specular reflections.
- Type
number- Default
1.6- Range / values
0–3
Horizontal direction of the virtual light in degrees.
- Type
number- Default
58- Range / values
0–360
Height of the virtual light above the field in degrees.
- Type
number- Default
60- Range / values
0–90
Focus of the specular reflection across the field.
- Type
number- Default
60- Range / values
2–80
Darkening applied toward the outer edges.
- Type
number- Default
1- Range / values
0–1
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