Pixel Flow
Flowing violet light rendered through a fine, animated dithered pixel field.
Installation#
pnpm dlx shadcn@latest add @davinciui/pixel-flowUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
presetColor preset. Explicit color props override the preset. | "reference-purple" | "monochrome" | "electric-blue" | "aurora" | "warm" | "reference-purple" |
pixelSizeVirtual pixel size in screen pixels. Smaller values densify the grid. | number | 4 |
pixelDensityGrid density multiplier. Higher values pack more cells. | number | 1 |
dotSizeSquare dot half-size within a cell, 0 to 0.7 units. | number | 0.2 |
dotStrengthStrength of the dark dot matrix overlay. | number | 0.12 |
ditherStrengthOrdered pixel coverage. Set to 0 for a continuous color field. | number | 1 |
speedGlobal animation rate. | number | 0.75 |
flowStrengthAdvection strength of the time flow. | number | 1 |
warpStrengthDomain-warp amplitude of the field. | number | 1 |
noiseScaleBase sampling frequency of the noise field. | number | 1.7 |
octavesFBM octave count, 1 to 6. | number | 4 |
contrastField contrast around mid-gray. | number | 1.25 |
softnessSoftness of palette transitions. | number | 0.65 |
backgroundColorDeepest field color. | string | "#0d0820" |
shadowColorDark violet region color. | string | "#1a1038" |
primaryColorMuted violet midtone. | string | "#33266b" |
electricColorSoft purple mid-highlight color. | string | "#6345b8" |
secondaryColorLavender transition color. | string | "#796bac" |
highlightColorPale lavender-gray highlight color. | string | "#9789c6" |
brightnessPost brightness multiplier. | number | 1 |
saturationPost saturation multiplier. | number | 0.92 |
qualityBacking-store resolution multiplier, 0.25 to 1. Lower values are faster. | number | 1 |
animateSet to false to freeze the current composition. | boolean | true |
pauseWhenOffscreenPause rendering while outside the viewport. | boolean | true |
respectReducedMotionRender one static frame for reduced-motion users. | boolean | true |
maxDprMaximum device pixel ratio for the backing buffer. | number | 2 |
classNameAdditional classes for the outer element. | string | — |
Accessibility#
Purely decorative: the host and fallback both set aria-hidden and pointer-events none, so the shader exposes no text, controls, or keyboard interaction to assistive technology.
Motion#
A requestAnimationFrame loop advances noise time, with speed setting the rate, flowStrength and warpStrength shaping movement, and animate freezing it. respectReducedMotion uses matchMedia to draw one static frame, and offscreen rendering pauses by default.
Known constraints#
- Requires WebGL; when the context is unavailable the host marks the fallback state and skips the shader.
- Reduced motion stops the flow animation while preserving the rendered frame.
- The canvas is sized by its host, so give the section a height before mounting it.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

