Join our Discord Community

React Noise Background

Film grain texture that makes digital interfaces feel organic and authentic. Build cinematic React background components with canvas rendering, CSS blend modes, animated patterns, and TypeScript support for Next.js applications with shadcn/ui.

Adding texture to digital designs?

Join our Discord community for help from other developers.


Perfect digital is boring. Too clean, too sterile, too obviously computer-generated. Real materials have texture—film grain, paper fibers, canvas weave. This React component adds organic noise patterns that make your interfaces feel authentic, like they exist in the physical world instead of floating in digital space.

Organic grain textures

Watch animated grain patterns add life and authenticity to digital surfaces:

Loading component...

Built for React applications with TypeScript and Next.js. Uses HTML5 Canvas with requestAnimationFrame for smooth grain animation. CSS blend modes (overlay, multiply, screen) integrate the texture naturally with your content. Perfect for photography sites, creative portfolios, or any design that needs to feel less digital.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/noise.json
npx shadcn@latest add https://www.shadcn.io/registry/noise.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/noise.json
bunx shadcn@latest add https://www.shadcn.io/registry/noise.json

Usage

import { Noise } from "@/components/ui/noise";

export default function FilmPortfolio() {
  return (
    <div className="relative h-screen bg-black">
      {/* Your content */}
      <div className="relative z-10 flex items-center justify-center h-full">
        <h1 className="text-6xl font-bold text-white">
          Authentic Photography
        </h1>
      </div>
      
      {/* Film grain overlay */}
      <div className="absolute inset-0 mix-blend-overlay">
        <Noise
          patternSize={100}
          patternScaleX={1}
          patternScaleY={1} 
          patternRefreshInterval={2}
          patternAlpha={25}
        />
      </div>
    </div>
  );
}

Why most texture effects look fake

Most developers use static PNG overlays or CSS background-image patterns. It's lifeless—the same pattern repeated forever, obviously tiled. Others try JavaScript particle systems that eat CPU generating "random" dots. Some use CSS filters like blur() and contrast(), but it looks like a Instagram filter from 2012.

This React component generates real grain using Canvas with Math.random() for each pixel. The pattern refreshes every few frames, creating that living, breathing texture of real film grain. CSS blend modes integrate it naturally—overlay for subtle texture, multiply for darker grain, screen for lighter effects. It's the difference between authentic film grain and a digital filter.

Features

  • Canvas-based grain generation using pixel-level randomization for authentic texture
  • Animated pattern refresh with configurable intervals for living, breathing grain
  • CSS blend mode integration supporting overlay, multiply, screen, and other creative effects
  • Independent scale control with separate X/Y scaling for directional grain effects
  • Precision opacity control using 0-255 alpha values for subtle to dramatic texture
  • High-performance rendering using requestAnimationFrame and optimized canvas operations
  • Responsive container adaptation automatically adjusting to window and container changes
  • TypeScript definitions for all grain parameters and visual customizations
  • Memory efficient implementation preventing performance degradation over time
  • shadcn/ui compatible with proper layering and blend mode support

Examples

Pattern Variations

Explore different grain types from fine film grain to coarse texture:

Loading component...

API Reference

Noise

Main component for canvas-based animated grain texture effects.

PropTypeDefaultDescription
patternSizenumber250Base resolution of grain pattern in pixels
patternScaleXnumber1Horizontal stretch factor for directional grain
patternScaleYnumber1Vertical stretch factor for directional grain
patternRefreshIntervalnumber2Animation frames between pattern updates (1-100)
patternAlphanumber15Grain opacity (0-255, recommend 10-40 for subtlety)
classNamestring-Additional CSS classes for container styling

Grain Pattern Guidelines

// Subtle film grain (most common)
patternSize={100} patternAlpha={20} patternRefreshInterval={3}

// Fine detail grain
patternSize={50} patternAlpha={15} patternRefreshInterval={1}

// Heavy texture grain  
patternSize={200} patternAlpha={40} patternRefreshInterval={5}

// Static texture (no animation)
patternSize={150} patternAlpha={25} patternRefreshInterval={1000}

CSS Blend Mode Effects

  • mix-blend-overlay - Natural film grain integration (most popular)
  • mix-blend-multiply - Darker grain that deepens colors
  • mix-blend-screen - Lighter grain that brightens highlights
  • mix-blend-soft-light - Gentle contrast enhancement
  • mix-blend-hard-light - Dramatic contrast and texture

Common gotchas

Blend mode browser support: Most blend modes work everywhere, but some older browsers might not support all variants. overlay and multiply are the safest options.

Performance with large patterns: Very large patternSize values (500+) can impact performance. The canvas has to generate more pixels. Stick to 50-300 for best balance.

Alpha value confusion: patternAlpha uses 0-255 scale, not 0-1 like CSS opacity. Values above 50 often look too heavy. 10-30 is the sweet spot for subtle grain.

Refresh interval timing: Lower values = faster animation but higher CPU usage. Very fast refresh (interval: 1) can cause performance issues on older devices.

Z-index layering conflicts: Noise typically goes on top with blend modes. If your content disappears, check z-index values and blend mode compatibility.

Canvas sizing edge cases: The canvas adapts to container size. Very small containers might not show grain effectively. Minimum 100px recommended.

You might also like

Explore other texture and atmospheric background components for React applications:

Questions developers actually ask