Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Backgrounds

  • DotPattern
  • GridPattern
  • StripedPattern
  • Spotlight
  • FadeMask
  • RetroGrid
  • Ripple
  • Meteors
  • Aurora
  • Particles
  • FlickeringGrid
  • WavyBackground
  • Silk
  • Iridescence
  • Threads
  • Orb
  • LiquidChrome
  • Balatro
  • Ballpit
  • Beams
  • ColorBends
  • DarkVeil
  • Dither
  • DotField
  • EvilEye
  • FaultyTerminal
  • Ferrofluid
  • FloatingLines
  • Galaxy
  • GradientBlinds
  • Grainient
  • GridDistortion
  • GridMotion
  • GridScan
  • Hyperspeed
  • LetterGlitch
  • Lightfall
  • Lightning
  • LightPillar
  • LightRays
  • LineWaves
  • LiquidEther
  • PixelBlast
  • PixelSnow
  • Plasma
  • PlasmaWave
  • Prism
  • PrismaticBurst
  • Radar
  • RippleGrid
  • ShapeGrid
  • SideRays
  • SoftAurora

Overlay Effects

  • BorderBeam
  • ShineBorder
  • GlareHover
  • Lens
  • AnimatedBeam
  • OrbitingCircles
  • ProgressiveBlur
  • CardSpotlight
  • Reveal
  • Antigravity
  • BlobCursor
  • ClickSpark
  • Crosshair
  • ElectricBorder
  • GhostCursor
  • GradualBlur
  • ImageTrail
  • LaserFlow
  • MagicRings
  • Magnet
  • MagnetLines
  • MetaBalls
  • MetallicPaint
  • OrbitImages
  • PixelTrail
  • PixelTransition
  • Ribbons
  • ShapeBlur
  • SplashCursor
  • StarBorder
  • StickerPeel
  • TargetCursor
  • Cubes
  • Tilt
  • BorderGlow
  • GlassIcons
  • GlassSurface
  • Lanyard
  • ModelViewer
  • FluidGlass

LightRays

light-rays

Projects pulsing volumetric rays from a configurable origin with pointer steering.

Usage

Basic usage

The default top-center radiates downward from the top center, and the component comes with absolute inset-0 z-0.

LightRays
tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.13 0.02 265)" }}>
  <LightRays raysOrigin="top-center" className="opacity-90" />
  <div className="relative z-10 flex h-full items-center justify-center text-sm font-medium text-white/80">
    LightRays
  </div>
</div>

Left side shot · Warm color

raysOrigin changes the direction, raysColor transfers warm colors, and lightSpread adjusts the focus.

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.13 0.02 265)" }}>
  <LightRays
    raysOrigin="left"
    raysColor="oklch(0.78 0.16 70)"
    lightSpread={0.8}
    className="opacity-90"
  />
</div>

Pulsation + Noise texture

pulsating has overall brightness breathing, noiseAmount has superimposed subtle noise.

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.13 0.02 265)" }}>
  <LightRays
    raysOrigin="top-center"
    pulsating
    noiseAmount={0.25}
    raysSpeed={1.4}
    className="opacity-90"
  />
</div>

Bottom up shot · Gathering narrow beam

bottom-center + small lightSpread are gathered into a narrow beam, children is stacked with headers (note: component root aria-hidden).

Hulian component library

Volume Beam · WebGL · token Shading

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.13 0.02 265)" }}>
  <LightRays
    raysOrigin="bottom-center"
    lightSpread={0.4}
    rayLength={2.6}
    distortion={0.3}
    followMouse={false}
    className="opacity-90"
  >
    <div className="flex h-full flex-col items-center justify-center gap-1">
      <p className="text-lg font-semibold text-white">Hulian Component Library</p>
      <p className="text-xs text-white/60">Volume Beam · WebGL · token Coloring</p>
    </div>
  </LightRays>
</div>

When to Use

Use it for a hero backdrop of volumetric rays emitted from one of eight origins and deflected by pointer movement. Use LightPillar for one concentrated column, Lightfall for descending illumination, or Lightning for intermittent electric arcs.

Import

ts
import { LightRays } from "@hulianui/ui"

Props

NameTypeDefaultDescription
raysOrigin"top-center" | "top-left" | "top-right" | "left" | "right" | "bottom-left" | "bottom-center" | "bottom-right""top-center"Beam emission origin, determines anchor point and propagation direction (four corners/four sides midpoint)
raysColorstringvar(--color-chart-1)Beam color, any CSS color, off-screen canvas parsed to RGB
raysSpeednumber1Blink/rhythm speed multiplier, 0 is almost static (still renders one frame)
lightSpreadnumber1Beam diffusion angle, the larger it is, the more scattered it is, the smaller it is, the more it is gathered together, it is recommended to be 0.3-3
rayLengthnumber2Beam length (multiple of relative viewport width)
pulsatingbooleanfalseOverall brightness sinusoidal breathing over time
fadeDistancenumber1The fade distance along the way (relative to the multiple of the viewport width), the smaller it is, the faster it fades out
saturationnumber1Saturation, <1 to remove color and tend to gray, 0=pure gray scale
followMousebooleantrueLets the beam direction follow the pointer; mouseInfluence > 0 is required for visible deflection
mouseInfluencenumber0.1Pointer influence on beam direction from 0-1; 0 disables deflection
noiseAmountnumber0Particle noise intensity (0-1)
distortionnumber0Angle distortion strength, making the beam sway rather than straight, recommended 0-1
classNamestring-Root container (comes with pointer-events-none absolute inset-0 z-0)
styleCSSProperties-Forward the root container inline style

Slots

SlotTypeDescription
childrenReactNodeContent overlaid on the beam layer, both WebGL and downgrade paths are rendered
fallbackReactNodereduced-motion / hidden content superimposed on static gradients without WebGL

Usage Guidelines

  • The component comes with pointer-events-none absolute inset-0 z-0, and the overlay content must be relative z-10 on top of it.
  • followMouse defaults to true, but mouseInfluence > 0 is required for visible deflection. Set mouseInfluence={0} for a stationary direction.
  • ogl/WebGL client only; SSR/no WebGL outsources static gradients and downgrades reduced-motion. children Both paths are rendered to ensure DOM consistency.
  • raysColor The --color- prefix token must be used to pass CSS variables, see [[hulian-token-color-var-needs-color-prefix]].
  • Fullscreen background layers in a non-cascading context parent of an opaque background may be obscured by the parent background, see [[webgl-canvas-rendered-but-invisible-negative-zindex-covered]].

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

LightRays
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.13 0.02 265)" }}>
  <LightRays
    raysOrigin="top-center"
    raysSpeed={1}
    lightSpread={1}
    rayLength={2}
    pulsating={false}
    followMouse={true}
    className="opacity-90"
  />
</div>
PreviousLightPillarDecorationNextLineWaves

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Slots
    • Usage Guidelines
    • Related
  • Playground