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

DotField

dot-field

Pushes and illuminates a canvas dot field around pointer movement.

Usage

Basic usage

Dot matrix background, move the mouse to push the lattice and glow below; the default color is chart / primary token.

Padded content determines the container height and layers above the interactive dot-field backdrop.
tsx
<div className="relative overflow-hidden rounded-xl bg-neutral-950 p-8">
  <DotField />
  <div className="relative z-10">Foreground content determines the container height</div>
</div>

Sparse lattice + strong bulging

Increase dotSpacing to make the dot matrix sparser, and increase bulgeStrength / cursorRadius to get a more exaggerated bulge.

Padded content determines the container height and layers above the interactive dot-field backdrop.
tsx
<DotField dotSpacing={22} dotRadius={2} bulgeStrength={80} cursorRadius={260} />

Waves + Stars twinkling

waveAmplitude allows the entire dot matrix to breathe sinusoidally, and sparkle allows a small number of points to occasionally enlarge into star points.

Padded content determines the container height and layers above the interactive dot-field backdrop.
tsx
<DotField waveAmplitude={5} sparkle dotSpacing={16} />

Custom color

color controls point color, glowColor controls glow color; any CSS color string can be used.

Padded content determines the container height and layers above the interactive dot-field backdrop.
tsx
<DotField color="oklch(0.75 0.2 50)" glowColor="oklch(0.7 0.18 200)" />

When to Use

Use it for an interactive dot-matrix backdrop that displaces and glows around the pointer, such as a technology hero, console surface, or empty state. Use DotPattern for a lighter static CSS pattern, Beams for a light curtain, or Balatro for a vortex. DotField trades some rendering cost for realtime pointer response.

Import

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

Props

NameTypeDefaultDescription
dotRadiusnumber1.5Drawing radius of a single point (px), recommended 1-3
dotSpacingnumber14Distance between adjacent dots in pixels; higher values create a sparser field, with 8-24 recommended
cursorRadiusnumber220Cursor influence radius (px), how many points around the pointer are pushed
bulgeStrengthnumber56Maximum dot displacement in pixels; 0 keeps the glow but disables displacement
colorstring--color-chart-1Dot matrix base color, CSS color string; token must be prefixed with --color-
glowColorstring--color-primaryRadial glow color at cursor
glowRadiusnumber160Glow radius in pixels; 0 disables the glow
waveAmplitudenumber0Global sinusoidal-wave amplitude in pixels; 0 disables the wave
sparklebooleanfalseOccasionally enlarge a small number of dots to create a twinkling effect
classNamestring-Additional className passed through to the root container
styleCSSProperties-Inline styles passed through to the root container

Usage Guidelines

  • Token colors require the --color- prefix: pass values such as var(--color-chart-1). Canvas cannot resolve bare names such as var(--chart-1), which can make dots black or remove the glow. See [[hulian-token-color-var-needs-color-prefix]].
  • Client rendering: the live effect uses Canvas 2D and requestAnimationFrame. SSR and reduced-motion environments render the static lattice fallback.
  • Positioning context: the host must establish a non-static positioning context with relative or another non-static position, and should use overflow-hidden; DotField fills that host with absolute inset-0. Layer foreground content above it with relative z-10; padded foreground content can determine the host height without a fixed height.

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

Padded content determines the container height and layers above the interactive dot-field backdrop.
<div className="relative overflow-hidden rounded-xl p-8"
     style={{ background: "oklch(0.14 0.02 280)" }}>
  <DotField
    dotSpacing={14}
    dotRadius={1.5}
    bulgeStrength={56}
    cursorRadius={220}
    waveAmplitude={0}
    sparkle={false}
  />
  <div className="relative z-10">Foreground content determines the container height</div>
</div>
PreviousDitherDecorationNextEvilEye

On this page

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