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

PixelSnow

pixel-snow

Raymarches a depth-faded pixel snow field with square, dot, or snowflake particles.

Usage

Basic usage

Put it into the relative overflow-hidden container; the default square pixel snow, the color is adaptive according to the brightness of the background behind you (dark bright snow / light dark snow).

PixelSnow
tsx
<div className="relative h-56 overflow-hidden rounded-xl bg-neutral-950">
  <PixelSnow />
  <div className="relative z-10 flex h-full items-center justify-center text-white/80">
    PixelSnow
  </div>
</div>

Shape variant

variant supports three snowflake shapes: square (square) / round (dot) / snowflake (six-armed snowflake).

tsx
<>
  <PixelSnow variant="snowflake" density={0.45} speed={1.6} />
  <PixelSnow variant="round" pixelResolution={90} density={0.4} />
</>

Retro large mosaic

Decrease pixelResolution (the number of "large pixels" cut horizontally) to make the mosaic blocks larger and have a stronger retro feel.

tsx
<PixelSnow variant="round" pixelResolution={90} density={0.4} />

Customized cold blue · slow wallpaper

color Connect to any CSS color to lock the snowflake tone; slow speed + moderate density as the snow background of the title area.

Hulian component library

Pixel Snow · Light and Dark Adaptive

tsx
<div className="relative h-56 overflow-hidden rounded-xl bg-neutral-950">
  <PixelSnow color="oklch(0.85 0.08 230)" speed={0.7} density={0.3} />
  <div className="relative z-10 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">Pixel Snow · Light and Dark Adaptive</p>
  </div>
</div>

When to Use

Use it for a falling-snow background on holiday pages, winter campaigns, or login screens. It provides depth fading and adaptive contrast against the surface behind it. For a regular dot field, use DotPattern; for a general animated retro pixel field, use PixelBlast.

Import

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

Props

NameTypeDefaultDescription
variant"square" | "round" | "snowflake""square"Snowflake shape: square pixel / dot / six-arm snowflake
colorstringAdaptive (--color-foreground, inverted on low contrast)Snowflake color. The default adapts to the backdrop so snow stays light on dark surfaces and dark on light surfaces
flakeSizenumber0.01Snowflake base size (screen space ratio); the bigger, the thicker
minFlakeSizenumber1.25Minimum projection size of distant snowflakes to prevent sub-pixels from disappearing
pixelResolutionnumber200Number of large pixels across the viewport; lower values create larger, more retro blocks
speednumber1.25Falling speed factor; the larger it is, the faster it passes through the field of view
depthFadenumber8Depth of field fade intensity; the larger the distance, the faster the snow attenuation and the stronger the depth
farPlanenumber20The furthest clipping distance of the light step; the larger the number, the more visible layers (the higher the performance cost)
brightnessnumber1Overall brightness ratio
gammanumber0.4545Gamma correction index (≈1/2.2 sRGB approximation)
densitynumber0.3Snowflake density (snow probability threshold for each grid); the larger, the denser. Recommended 0.05-0.6
directionnumber125Wind direction angle (degrees), determines the lateral drift direction
classNamestring-Passthrough to root container (or reduced-motion fallback div)

Slots

SlotTypeDescription
fallbackReactNodereduced-motion / static alternative content without WebGL; default white point + difference mixed static lattice snow

Usage Guidelines

  • The component covers the full canvas. The parent container must be relative, and overlay content must use relative z-10; otherwise the canvas can cover it. See [[webgl-canvas-rendered-but-invisible-negative-zindex-covered]].
  • color defaults to adaptive color selection based on the actual background color behind it. However, if the component is placed in a container that is opposite to the global theme (such as a dark box under a bright theme), the adaptation is inferred based on the token - explicitly passing color is more stable when the color is conflicting.
  • WebGL client component ("use client"); only fallback is rendered during the SSR phase.
  • Headless screenshots can capture a still or blank frame when rAF is throttled. Verify falling motion on a real device or with Playwright measurements; see [[recharts-headless-screenshot-blank-clippath-animation-starved]].

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

PixelSnow
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.13 0.02 255)" }}>
  <PixelSnow
    variant="square"
    density={0.3}
    speed={1.25}
    pixelResolution={200}
    direction={125}
  />
</div>
PreviousPixelBlastDecorationNextPlasma

On this page

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