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

PixelBlast

pixel-blast

Quantizes animated noise into configurable pixel shapes with ordered dithering.

Usage

Basic usage

Put it into the relative overflow-hidden container. The component comes with absolute inset-0 z-0; the default square lattice, the main color reads --color-primary, and the light and shade are adaptive.

PixelBlast

tsx
<div className="relative h-64 overflow-hidden rounded-xl bg-neutral-950">
  <PixelBlast />
  <div className="relative z-10 flex h-full items-center justify-center">
    <p className="text-2xl font-bold text-white/90">PixelBlast</p>
  </div>
</div>

Shape variant

variant supports four pixel unit shapes square / circle / triangle / diamond, and pixelSize controls the single cell size.

circle · Dot printing feel

triangle · Textured

diamond · Staggered particles

tsx
<>
  <PixelBlast variant="circle" pixelSize={6} />
  <PixelBlast variant="triangle" patternDensity={1.3} />
  <PixelBlast variant="diamond" pixelSize={5} />
</>

Custom color + strong fade

color is connected to any CSS color; edgeFade is increased to make the four corners fade out softer, making it easier to use the dot matrix as the content background.

Aurora Blue Purple · Slow Wallpaper

tsx
<PixelBlast
  variant="square"
  color="oklch(0.65 0.26 285)"
  speed={0.25}
  patternScale={1.5}
  edgeFade={0.7}
/>

No fade overlay

edgeFade={0} Cancel the surrounding fade, and the hard edge of the dot matrix covers the entire container.

edgeFade = 0 · Full

tsx
<PixelBlast variant="circle" color="oklch(0.74 0.18 55)" edgeFade={0} pixelSize={5} />

When to Use

Use it for an animated retro halftone or dot-print background with built-in edge fading for layered content. For a static regular dot field, use DotPattern; for an 8-bit perspective grid, use RetroGrid; for a moving focus light, use Spotlight. PixelBlast adds noise-driven motion and optional size jitter.

Import

ts
import { PixelBlast, pixelBlastShowcase } from "@hulianui/ui"

Props

NameTypeDefaultDescription
variant"square" | "circle" | "triangle" | "diamond""square"Pixel unit shape: square (sharp retro) / dot (dot printing feel) / triangle (texture) / diamond (diamond dot)
pixelSizenumber4Pixel size in CSS pixels; lower values are denser and finer. Recommended range 2-12
colorstring--color-primaryPixel main color, CSS color string; default is primary token light and dark adaptive
patternScalenumber2Noise texture scaling; the larger the patches, the finer and denser the flashes. Recommendation 0.5-6
patternDensitynumber1Pixel filling density; the larger it is, the more pixels will be lit and the more "full" it will be. Recommendation 0.4-1.6
pixelSizeJitternumber0Random jitter amplitude for each square size 0-1; the larger, the more jagged, the stronger the graininess
speednumber0.5Animation speed factor; 0 = still picture (still renders one frame of static lattice)
edgeFadenumber0.5Edge-fade width from 0-1 relative to the shorter side; 0 keeps hard edges, while higher values soften the corners
classNamestring-Additional class name for the root container or reduced-motion fallback div
styleCSSProperties-Inline styles passed through to the root container

Slots

SlotTypeDescription
fallbackReactNodereduced-motion / static alternative content without WebGL; default primary token radial-gradient dot matrix (CSS mask simulated dots)

Usage Guidelines

  • The component comes with absolute inset-0 z-0, the parent container must be relative, and the overlay content must be relative z-10, otherwise the content [[webgl-canvas-rendered-but-invisible-negative-zindex-covered]] will be covered.
  • WebGL client component ("use client"); only fallback is rendered during the SSR phase.
  • color is parsed by off-screen canvas when passing var(--color-…), must be prefixed with --color-, and the parsing of bare var(--primary) fails with [[oklch-css-var-color-must-parse-via-offscreen-canvas]].
  • Headless screenshots can capture a still or blank frame when rAF is throttled. Verify 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

PixelBlast · WebGL Background

<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.12 0.02 285)" }}>
  <PixelBlast
    variant="square"
    pixelSize={4}
    patternScale={2}
    patternDensity={1}
    pixelSizeJitter={0}
    speed={0.5}
    edgeFade={0.5}
  />
  <div className="relative z-10">Content</div>
</div>
PreviousLiquidEtherDecorationNextPixelSnow

On this page

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