Skip to content

Grain

Tube noise over anything. A static filter by default, or a capped canvas loop that pauses off screen.

0.13
64 KB
Clean
64 KB
Grain

The blend is screen, so the noise reads in the blacks rather than only over lit content.

Installation

npx shadcn@latest add @afterglow/grain

API Reference

The blend is screen, so the noise reads in the blacks. Over a light surface it all but disappears; raise opacity to bring it back.

animated caps its frame rate at fps, stops painting while it is off screen, and falls back to the static filter under reduced motion.

Grain

An absolutely positioned overlay for the element it sits in. Static by default, which is one feTurbulence paint and no JavaScript.

PropTypeDefault
animatedbooleanfalse
fpsnumber24
opacitynumber0.13