- Docs
- Components
- Backgrounds
- Pixel Rain
Pixel Rain
Pixelated streaks falling in a quiet digital rain
Customize
Props
26| Name | Type | Default | Description |
|---|---|---|---|
width | string | number | "100%" | Container width. |
height | string | number | "100%" | Container height. |
className | string | - | Additional CSS classes. |
children | ReactNode | - | Content rendered above the effect. |
columnWidth | number | 3 | Width of one rain column in CSS pixels. |
speed | number | 0.2 | How fast the columns sweep. |
scatter | number | 2.5 | Spread of the per-column scatter. Higher values decorrelate neighbours. |
waveFrequency | number | 0.2 | Frequency of the slow wave riding across the columns. |
waveAmplitude | number | 0.6 | Strength of the slow wave riding across the columns. |
trail | number | 6 | Length of each streak. Higher values give shorter streaks. |
ambient | number | 0 | Ambient level held between streaks. |
color | string | "#a54693" | Colour of the streaks. |
hotColor | string | "#a54693" | Colour the brightest part of a streak shifts toward. |
backgroundColor | string | "#0a0a0a" | Background fill colour. Accepts "transparent". |
direction | "down" | "up" | "down" | Travel direction of the streaks. |
brightness | number | 1 | Overall gain. |
gamma | number | 1 | Contrast curve applied at the end. |
vignette | number | 0 | Darkening toward the edges from 0 to 1. |
opacity | number | 1 | Master alpha from 0 to 1. |
cursorInteraction | boolean | true | Let the pointer brighten nearby columns. |
cursorGlow | number | 0.9 | How much nearby columns brighten. |
cursorReach | number | 0.12 | Reach of the pointer highlight from 0 to 1. |
adaptiveQuality | boolean | true | Drop resolution when the frame rate falls short. |
targetFps | number | 60 | Frame rate the adaptive pass aims for. |
dpr | number | 2 | Upper bound on device pixel ratio. |
paused | boolean | false | Hold the animation still. |
widthstring | numberContainer width.
"100%"heightstring | numberContainer height.
"100%"classNamestringAdditional CSS classes.
-childrenReactNodeContent rendered above the effect.
-columnWidthnumberWidth of one rain column in CSS pixels.
3speednumberHow fast the columns sweep.
0.2scatternumberSpread of the per-column scatter. Higher values decorrelate neighbours.
2.5waveFrequencynumberFrequency of the slow wave riding across the columns.
0.2waveAmplitudenumberStrength of the slow wave riding across the columns.
0.6trailnumberLength of each streak. Higher values give shorter streaks.
6ambientnumberAmbient level held between streaks.
0colorstringColour of the streaks.
"#a54693"hotColorstringColour the brightest part of a streak shifts toward.
"#a54693"backgroundColorstringBackground fill colour. Accepts "transparent".
"#0a0a0a"direction"down" | "up"Travel direction of the streaks.
"down"brightnessnumberOverall gain.
1gammanumberContrast curve applied at the end.
1vignettenumberDarkening toward the edges from 0 to 1.
0opacitynumberMaster alpha from 0 to 1.
1cursorInteractionbooleanLet the pointer brighten nearby columns.
truecursorGlownumberHow much nearby columns brighten.
0.9cursorReachnumberReach of the pointer highlight from 0 to 1.
0.12adaptiveQualitybooleanDrop resolution when the frame rate falls short.
truetargetFpsnumberFrame rate the adaptive pass aims for.
60dprnumberUpper bound on device pixel ratio.
2pausedbooleanHold the animation still.
false