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

GridScan

grid-scan

Projects an infinite perspective grid with a traveling luminous scan pulse.

Usage

Basic usage

Default round-trip scan; children layered on top of perspective grid via relative z-10.

Content layer
tsx
<div className="relative h-64 overflow-hidden rounded-xl bg-neutral-950">
  <GridScan>
    <div className="flex h-full items-center justify-center text-white/80">
      Content layer
    </div>
  </GridScan>
</div>

Dashed grid · Scan forward

lineStyle switches among solid, dashed, and dotted lines; scanDirection controls the scan direction.

tsx
<GridScan lineStyle="dashed" scanDirection="forward" scanOpacity={0.6} />

Dotted line grid + custom scan color

gridScale The smaller the grid, the denser it is. scanColor changes the scanning pulse luminous color.

tsx
<GridScan lineStyle="dotted" gridScale={0.07} scanColor="var(--color-chart-4)" />

Sparse slow scan (wallpaper level)

Large gridScale + long scanDuration + high scanSoftness to get a leisurely wide light band.

tsx
<GridScan
  gridScale={0.18}
  scanDuration={4}
  scanDelay={1}
  scanSoftness={3}
  scanColor="var(--color-chart-1)"
/>

When to Use

Use GridScan behind a technology hero or dashboard when the grid should recede in perspective and a scan band should move from far to near, near to far, or in both directions. Choose GridPattern for a lightweight static grid, or RetroGrid for a CSS perspective horizon with a retro aesthetic.

Import

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

Props

NameTypeDefaultDescription
linesColorstringvar(--color-border)Grid-line color; accepts any CSS color and defaults to the theme-aware border token
scanColorstringvar(--color-primary)Color of the luminous scan band; accepts any CSS color and defaults to the primary token
gridScalenumber0.1Grid-cell scale; lower values create a denser grid, with 0.05-0.3 recommended
lineThicknessnumber1Grid-line thickness in screen pixels
lineStyle"solid" | "dashed" | "dotted""solid"Pattern applied to both grid axes
scanOpacitynumber0.45Scan-band opacity from 0 to 1; 0 leaves only the grid
scanDirection"forward" | "backward" | "pingpong""pingpong"forward moves far to near, backward near to far, and pingpong alternates directions
scanDurationnumber2Duration of one scan in seconds
scanDelaynumber2Delay in seconds before each one-way scan; in pingpong mode it delays only the initial movement
scanSoftnessnumber2Scan-band softness; higher values make the band wider and softer
noiseIntensitynumber0.01Fine screen-space grain; 0 produces a clean image
parallaxbooleantrueTilt the camera slightly toward pointer movement that reaches the root; ignored by the reduced-motion fallback
classNamestring-Class name forwarded to the live or fallback root

Slots

SlotTypeDescription
childrenReactNodePurely decorative content wrapped in a full-size relative z-10 layer; it remains inside the root's aria-hidden subtree
fallbackReactNodePurely decorative content rendered inside the static token-colored grid when reduced motion is enabled

Usage Guidelines

  • GridScan is an absolute inset-0 z-0 decorative layer. Put it in a relative container with an explicit height and overflow-hidden, then place necessary, accessible foreground content in a sibling at relative z-10 or above.
  • Both children and fallback remain inside GridScan's aria-hidden root. Use them only for decoration that does not need to enter the accessibility tree.
  • OGL/WebGL starts on the client. During SSR, the live root has no canvas. After hydration, a canvas is appended before OGL import and scene setup; if either step fails, that uninitialized or blank canvas remains and the component does not switch to the reduced-motion fallback. Reduced motion instead renders the static grid plus decorative children and fallback.
  • The live root defaults to pointer-events-none. Add pointer-events-auto through className if parallax is required, and make sure covering siblings do not take those pointer hits.
  • An opaque parent in a separate stacking context can cover a full-size background layer. If the canvas exists but is invisible, inspect stacking and background paint; see [[webgl-canvas-rendered-but-invisible-negative-zindex-covered]].
  • CSS variables for scanColor and linesColor require full token names such as var(--color-primary). Bare values such as var(--primary) do not resolve; see [[hulian-token-color-var-needs-color-prefix]].

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.13 0.02 265)" }}>
  <GridScan
    gridScale={0.1}
    lineThickness={1}
    lineStyle="solid"
    scanDirection="pingpong"
    scanOpacity={0.45}
    scanDuration={2}
  />
</div>
PreviousGridMotionDecorationNextHyperspeed

On this page

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