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

Lightning

lightning

Generates flickering noise-driven electric arcs with inverse-distance glow.

Usage

Basic usage

The default blue-purple phase is 230, the component comes with absolute inset-0 z-0, and the content overlaps z-10.

Lightning

fbm Noise arc background

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.10 0.02 265)" }}>
  <Lightning />
  <div className="relative z-10 flex h-full flex-col items-center justify-center gap-2">
    <p className="text-2xl font-bold tracking-tight text-white/90">Lightning</p>
    <p className="text-sm text-white/50">fbm Noise arc background</p>
  </div>
</div>

Warm orange phase (high intensity)

​​hue=30 Cut warm orange, intensity / speed turn it up to be brighter and noisier.

hue = 30

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.10 0.02 265)" }}>
  <Lightning hue={30} intensity={1.4} speed={1.3} />
</div>

Eat chart token (light and dark adaptive)

Pass color to cover the hue path, shader directly eat token, and follow the theme switching.

token Color Picking · Light and Dark Adaptive

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.10 0.02 265)" }}>
  <Lightning color="var(--color-chart-1)" intensity={1.2} />
</div>

Fine and slow battery

size turns it up to make the splits thinner, and speed turns it down to make the surge more soothing.

size=1.6 · speed=0.6

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.10 0.02 265)" }}>
  <Lightning size={1.6} speed={0.6} hue={280} />
</div>

When to Use

Use it when you need a vertical arc/aurora glow background and a technological hero with random flashes. For a single stable volumetric beam use LightPillar; for a radial beam use LightRays; for a falling beam use Lightfall.

Import

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

Props

NameTypeDefaultDescription
huenumber230Lightning hue (0-360, HSV color wheel), only effective when color is not passed. Example 30 warm orange / 120 turquoise / 280 magenta
colorstringundefinedExplicit lightning color. When set, it overrides hue; use var(--color-chart-1) for theme-aware token color
xOffsetnumber0Horizontal offset (clip-space), positive values push to the right, negative values push to the left
speednumber1Animation speed factor, the larger the factor, the faster the flashing/surging
intensitynumber1Brightness intensity, the larger, the brighter and the thicker
sizenumber1Noise scale, the larger the bifurcation, the finer the bifurcation, the smaller the more macroscopic
classNamestring-Additional class name for the root container or fallback div

Slots

SlotTypeDescription
fallbackReactNodereduced-motion / static replacement content without WebGL, default token vertical glow gradient

Usage Guidelines

  • Choose one of color and hue: if color is passed, hue will be invalid. For token adaptation, color="var(--color-chart-1)" is preferred.
  • OGL/WebGL renders on the client; SSR, reduced motion, and unavailable WebGL use the token-gradient fallback.
  • color must use the --color- prefix token when passing CSS variables. The bare var(--primary) shader does not parse, 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

Lightning · WebGL Background

<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.10 0.02 265)" }}>
  <Lightning
    hue={230}
    speed={1}
    intensity={1}
    size={1}
    xOffset={0}
  />
  <div className="relative z-10">Content</div>
</div>
PreviousLightfallDecorationNextLightPillar

On this page

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