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

PixelTrail

pixel-trail

Leaves a fading pixel-grid trail behind pointer movement.

Usage

Basic usage

Cover the container, the mouse moves over the pixel grid, and the trailing fades out over time.

Move the mouse within this area
tsx
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <PixelTrail className="absolute inset-0" />
</div>

Fine mesh + short afterglow

Increase gridSize to make the pixels finer, and lower maxAge to make the trailing shorter.

Move the mouse within this area
tsx
<PixelTrail
  gridSize={72}
  maxAge={200}
  color="var(--color-chart-2)"
  className="absolute inset-0"
/>

Coarse grain + long afterglow

Lower gridSize, increase trailSize and maxAge, retro grain + long tail.

Move the mouse within this area
tsx
<PixelTrail
  gridSize={24}
  trailSize={0.16}
  maxAge={600}
  color="var(--color-chart-4)"
  className="absolute inset-0"
/>

Mucus Fusion

gooey=true With the SVG filter enabled, adjacent pixels merge into an organic liquid clump.

Move the mouse within this area
tsx
<PixelTrail
  gridSize={48}
  trailSize={0.14}
  gooey
  gooeyStrength={9}
  color="var(--color-chart-1)"
  className="absolute inset-0"
/>

When to Use

Use it for a retro interactive background where pointer movement lights grid cells that fade into an afterglow. Choose hard-edged pixels or merge neighboring cells into gooey blobs. For fluid splashes, use SplashCursor; for elastic ribbons, use Ribbons.

Import

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

Props

NameTypeDefaultDescription
gridSizenumber40The number of horizontal pixel grids (vertically calculated automatically in proportion to maintain the square grid), recommended 16-120
trailSizenumber0.1Trailing influence radius (ratio of the short side of the container 0-1), the larger the tail, the thicker the trailing
maxAgenumber320The survival time of a single cell after it is lit (ms), the larger the value, the longer the afterglow
colorstringvar(--color-chart-1)Pixel color, token must be prefixed with --color-
gooeybooleanfalseEnable slime filter: adjacent points merge into a liquid blob instead of a hard-edged square
gooeyStrengthnumber8gooey fusion strength (Gaussian blur radius px), only effective when gooey=true
classNamestring-Additional class name for the root container, which defaults to block h-full w-full
styleCSSProperties-Passthrough to root container

Usage Guidelines

  • The color feeding token must be prefixed with --color-, and the bare var(--primary) shader will not parse it. See [[hulian-token-color-var-needs-color-prefix]].
  • WebGL/ogl component, client-side rendering only; StrictMode double-mounted canvas context reuse risk, see [[webgl-canvas-loseContext-poisons-strictmode-remount]].
  • The parent container needs to be relative + overflow-hidden, and the component should be absolute inset-0; the pixel afterglow is clearest on a dark background.

Related

BorderBeam · ShineBorder · GlareHover · Lens · AnimatedBeam · OrbitingCircles

Playground

Move the mouse within this area
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <PixelTrail
    gridSize={40}
    trailSize={0.1}
    maxAge={320}
    gooey={false}
    className="absolute inset-0"
  />
</div>
PreviousOrbitImagesDecorationNextPixelTransition

On this page

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