Astro Dither is an open-source Astro component library for animated dither backgrounds, gradients and image effects. It runs on plain Astro components and browser custom elements, with no React or client directives.

One registry includes 19 animated effects such as aurora, plasma, ripples, starfields and a spinning globe, along with dithered buttons, sliders, charts and shapes. Image dithering keeps the real img element and its alt text.

Ordered-dither elements on a page share a single WebGL context. Animations pause offscreen and in hidden tabs, and follow reduced-motion settings. Install it from npm or copy the source into your repo with the CLI.

What it does

  • 19 animated dither effects in one registry
  • Dithered buttons, sliders, charts and shapes
  • Image dithering that preserves the img element and alt text
  • Single shared WebGL context per page
  • Pauses offscreen, pauses in hidden tabs and follows reduced motion
  • Typed props for every effect and a CLI to copy source files

Screens