Updated
Light Stream
Customize
Colors
Background
Intensity1.35
Density0.85
Waist0.10
Flare1.55
Curve1.00
Angle-32°
Length0.55
Glow1.00
Chroma0.90
White0.80
Dust0.50
Dust size0.60
Dust glow0.5
up
Speed1.1
Grain0.065
Seed0
Lean0.40
Follow0.80
Installation
npx shadcn@latest add https://uibrik.com/r/light-stream.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-stream/light-stream.tsx"use client"; import { ShaderSurface, type ShaderBackgroundProps } from "../_shader-background/ShaderSurface"; // An hourglass of light: a stream of fine, iridescent streaks pinched at its waist and flaring out // at both ends, with glittering dust drifting through it. // // Every streak follows a flow line s = (x - bend(y)) / width(y), where the width is narrow at the // waist and opens up toward the top and bottom. Lines are evenly spaced in s, so they crowd together // (and brighten, since the same light passes through less room) at the waist and fan out at the // ends. Each line has its own position, thickness, tint from the colour list and a dash pattern that // runs along the flow, so the stream reads as moving light. Three layers of lines at different // densities give it depth; a soft bloom sits around the core, and a filmic curve lets the brightest // crossings burn to white. const SHADER = /* glsl */ ` uniform float u_intensity; // exposure uniform float u_density; // how many streaks uniform float u_waist; // width of the stream at its narrowest uniform float u_flare; // how much it opens toward the ends uniform float u_curve; // how much the stream bends and sways uniform float u_angle; // tilt, degrees uniform float u_length; // length of the streak dashes uniform float u_glow; // halo around each streak and haze around the core uniform float u_chroma; // colour fringing at the edges of the streaks
Adds the files to
components/uibrik/light-stream. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/light-stream.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 { LightStream } from "@/components/uibrik/light-stream/light-stream";const colors = ["#ff6a1a", "#ffb04a", "#fff0dc", "#ff7d2e", "#5fe3d3", "#9a78ff"];<LightStream colors={colors} background="#050505" intensity={1.35} density={0.85} waist={0.1} flare={1.55} curve={1} angle={-32} length={0.55} glow={1} chroma={0.9} white={0.8} dust={0.5} dustSize={0.6} dustGlow={0.5} direction="up" speed={1.1} grain={0.065} seed={0} animate interactive lean={0.4} follow={0.8}> …</LightStream>Where to use Light Stream
AI and crypto heroes
An hourglass of iridescent streaks gives a dark hero a glossy focal point.
Launch pages
Glittering dust flowing through the dark suits product reveals.
Premium dark sections
The stream works as a section backdrop behind a single key message.
Props
LightStream- colors
- Type string[]
- ["#ff6a1a","#ffb04a","#fff0dc","#ff7d2e","#5fe3d3","#9a78ff"]
- Streak tints; the first also warms the glow. 2 to 6 colours.
- background
- Type string
- "#050505"
- Colour behind the light.
- intensity
- Type number
- 1.35
- Exposure: how bright the light is.
- density
- Type number
- 0.85
- How many streaks; higher is finer and denser.
- waist
- Type number
- 0.1
- Width of the stream at its narrowest.
- flare
- Type number
- 1.55
- How much the stream opens toward its ends.
- curve
- Type number
- 1
- How much the stream bends and sways.
- angle
- Type number
- -32
- Tilt of the stream.
- length
- Type number
- 0.55
- Length of the streak dashes; larger is longer.
- glow
- Type number
- 1
- Halo around each streak and haze around the core.
- chroma
- Type number
- 0.9
- Colour fringing at the edges of the streaks.
- white
- Type number
- 0.8
- How much the hottest light burns to white.
- dust
- Type number
- 0.5
- Glittering dust along the stream.
- dustSize
- Type number
- 0.6
- Size of the dust sparks; each spark still varies around it.
- dustGlow
- Type number
- 0.5
- How many sparks carry a soft halo; 1 is about one in six.
- direction
- Type "up" | "down"
- "up"
- Which way the light flows.
- speed
- Type number
- 1.1
- Animation speed; 1 is the designed pace.
- grain
- Type number
- 0.065
- Film grain strength.
- seed
- Type number
- 0
- Shifts the composition, so two backgrounds with the same settings still differ.
- animate
- Type boolean
- true
- Move on its own. Off draws one still frame.
- interactive
- Type boolean
- true
- React to the pointer.
- lean
- Type number
- 0.4
- How far the stream bends toward the pointer.
- follow
- Type number
- 0.8
- How lazily the stream 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.