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

Dither

dither

Applies ordered dithering and palette quantization to animated noise waves.

Usage

Basic usage

Put it into the relative + overflow-hidden container. The component comes with absolute inset-0 z-0, and the content is stacked on top with z-10.

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

Pixel Art (Coarse Mosaic)

Increase pixelSize to make the dither particles thicker, and get the 8-bit retro texture with fewer color levels.

tsx
<Dither pixelSize={6} colorNum={3} />

Delicate color gradation

colorNum The larger, the more color levels, and the smoother and more delicate the texture.

tsx
<Dither colorNum={8} pixelSize={2} waveSpeed={0.08} />

Customized ripple color

Pass waveColor to overwrite the default chart token; any CSS color (hex / oklch / rgb) is acceptable.

tsx
<Dither waveColor="oklch(0.72 0.22 40)" colorNum={4} pixelSize={3} />

Freeze still frame

disableAnimation The frozen waveform is a static picture (equivalent to reduced-motion), suitable for static covers.

tsx
<Dither disableAnimation waveColor="oklch(0.72 0.22 40)" />

When to Use

Use it for an 8-bit, pixel-art ripple backdrop on nostalgic landing pages, game interfaces, or playful brand pages. Use Balatro for painted swirls, Beams for light curtains, or DotPattern for a regular dot matrix. Dither is the option built specifically around ordered dithering and color quantization.

Import

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

Props

NameTypeDefaultDescription
waveSpeednumber0.05Ripple flow speed; frozen to static image under reduced-motion
waveFrequencynumber3FBM frequency multiplier; higher values create finer ripple detail
waveAmplitudenumber0.3Per-octave amplitude factor; higher values preserve more high-frequency detail
waveColorstring--color-chart-1Main ripple color; accepts any CSS color and defaults to a light/dark theme token
colorNumnumber4Quantized color-step count used with the Bayer matrix; lower values look more 8-bit
pixelSizenumber2Dither-block size; higher values produce a coarser mosaic
disableAnimationbooleanfalseFreeze the wave field on a still frame, matching reduced-motion behavior
classNamestring-Class name forwarded to the canvas or fallback div

Slots

SlotTypeDescription
fallbackReactNodeStatic non-WebGL content for SSR, reduced motion, or unavailable WebGL; defaults to a checkerboard gradient

Usage Guidelines

  • WebGL client rendering: this effect relies on OGL and a single-pass shader. SSR renders the checkerboard-gradient fallback; do not import the realtime implementation directly into a server component.
  • Token colors require the --color- prefix: pass waveColor="var(--color-chart-1)". Bare names such as var(--chart-1) do not resolve. See [[hulian-token-color-var-needs-color-prefix]].
  • Lower colorNum values strengthen the 8-bit look, but very low values such as 2 discard substantial detail.
  • The parent container must be relative + overflow-hidden.

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

Dither
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <Dither
    colorNum={4}
    pixelSize={2}
    waveSpeed={0.05}
    disableAnimation={false}
  />
</div>
PreviousDarkVeilDecorationNextDotField

On this page

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