> ## Documentation Index
> Fetch the complete documentation index at: https://npm-packages.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Dithering

> A two-color, animated pixel field.

Package: [`@paper-design/shaders-react`](https://www.npmjs.com/package/@paper-design/shaders-react).

## Try it

Change the palette, then compare a small scale with a large one. Pause to inspect the texture. The controls use the package's actual shader parameters.

## Code

Initial configuration. The controls change the preview above.

```jsx Dithering.jsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { Dithering } from '@paper-design/shaders-react';

export function Example() {
  return (
    <Dithering
      width="100%"
      height={420}
      speed={0.4}
      scale={0.6}
      maxPixelCount={2000000}
      colorBack="#10091f"
      colorFront="#d9c6ff"
      shape="sphere"
      type="4x4"
      size={3}
      offsetX={0}
    />
  );
}
```

## Parameters

`size` changes the pixel grid. `type` chooses the dither matrix; try `"random"`, `"2x2"`, or `"8x8"` in your own component. `shape` changes the underlying field.

The preview honors reduced motion and includes a pause control. See the [Paper Shaders reference](https://shaders.paper.design/dithering).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.