Updated
Light Rain
Customize
Colors
Density1.00
Spread1.00
Glints1.00
Glint spacing1.00
Haze1.00
Intensity1.00
down
Speed1.0
Grain0.020
Radius160px
Follow0.70
Installation
npx shadcn@latest add https://uibrik.com/r/light-rain.jsonAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/light-rain/light-rain.tsx"use client"; import { ShaderSurface, type ShaderBackgroundProps } from "../_shader-background/ShaderSurface"; // Falling light: thin vertical lines of blue light, densest down the middle, with bright glints // sliding along them and a soft haze drifting between. Three layers of lines at different // densities (fine threads behind, a few strong lines in front). Each line has its own position, // width and brightness, brightens and fades along its length, and carries a couple of glints, each // a short bright core with a long soft tail. The brightness is mapped through the colour list, so // the light runs from deep navy through blue to a near-white core. const SHADER = /* glsl */ ` uniform float u_density; // how many lines uniform float u_spread; // how wide the band of lines is uniform float u_glints; // how many bright glints uniform float u_glintLength; uniform float u_haze; // soft glow drifting between the lines uniform float u_intensity; uniform float u_direction; // 1 falls, -1 rises uniform float u_radius; // reach of the pointer light, css px float lineLayer(vec2 frag, float t, float n, float layer, float band) { float x = frag.x / u_res.y * n; float id = floor(x); float f = fract(x) - 0.5;
Adds the files to
components/uibrik/light-rain. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/light-rain.Too large to paste whole, so Copy prompt gives a short prompt that installs it with the CLI. Download the full prompt to attach it instead.
Usage
import { LightRain } from "@/components/uibrik/light-rain/light-rain";const colors = ["#000000", "#071a46", "#1c4fb8", "#6ea6ff", "#eef5ff"];<LightRain colors={colors} density={1} spread={1} glints={1} glintLength={1} haze={1} intensity={1} direction="down" speed={1} grain={0.02} animate interactive radius={160} follow={0.7}> …</LightRain>Where to use Light Rain
Dark tech heroes
Thin falling lines of blue light add motion behind a developer or AI product headline.
Coming-soon pages
Glints sliding along the lines keep a sparse page alive.
Pairs with Waitlist Input
Data and cloud products
Streaming light suggests data flowing through a system.
Props
LightRain- colors
- Type string[]
- ["#000000","#071a46","#1c4fb8","#6ea6ff","#eef5ff"]
- Dark to bright: the light is mapped through these, blended in OKLCH.
- density
- Type number
- 1
- How many lines.
- spread
- Type number
- 1
- How wide the band of lines is.
- glints
- Type number
- 1
- How many bright glints slide along the lines.
- glintLength
- Type number
- 1
- Spacing of the glints along a line; larger is fewer.
- haze
- Type number
- 1
- Soft glow drifting between the lines.
- intensity
- Type number
- 1
- Brightness.
- direction
- Type "down" | "up"
- "down"
- Which way the light moves.
- speed
- Type number
- 1
- Animation speed; 1 is the designed pace.
- grain
- Type number
- 0.02
- Film grain strength.
- animate
- Type boolean
- true
- Move on its own. Off draws one still frame.
- interactive
- Type boolean
- true
- React to the pointer.
- radius
- Type number
- 160
- How far the pointer light reaches.
- follow
- Type number
- 0.7
- How lazily it follows the pointer, 0 (locked) to 1 (drifts after it).
- children
- Type ReactNode
- –
- Content shown on top of the background.
- className
- Type string
- –
- Classes for the box; it fills whatever size you give it.