Dithering

Documentation Index

Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.

Render an animated wave field with a configurable retro dithering pass.

dithering-demo

Overview

Dithering combines a flowing Three.js wave shader with a pixelated post-processing pass. Use it for full-bleed ambient media, experimental covers, and playful technical surfaces.

Installation

npm install honestui

Usage

import { Dither } from "honestui/shaders"

<div className="h-80 bg-black">
  <Dither
    colorNum={5}
    pixelSize={3}
    waveColor={[0.22, 0.48, 0.95]}
    waveFrequency={2.4}
  />
</div>

Accessibility

The pointer response is decorative. Set disableAnimation for a still frame and enableMouseInteraction={false} when pointer motion is not useful. Keep essential content outside the canvas.

API Reference

PropTypeDefaultDescription
waveSpeednumber0.05Rate of wave movement.
waveFrequencynumber3Number of wave cycles across the field.
waveAmplitudenumber0.3Height of the wave deformation.
waveColor[number, number, number][0.5, 0.5, 0.5]RGB color with values from zero to one.
colorNumnumber4Number of tonal steps in the dither pass.
pixelSizenumber2Dither pixel size.
disableAnimationbooleanfalseFreezes the time uniform.
enableMouseInteractionbooleantrueLets pointer movement influence the field.
mouseRadiusnumber1Radius of the pointer influence.