Background

Noise

Animated grain texture overlays with customizable patterns. Perfect for React applications requiring film-like visual effects with Next.js integration and TypeScript support.

Powered by

Loading component...

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

Features

  • Canvas-based grain animation with customizable pattern size, scale, and refresh rate parameters
  • High-performance rendering using HTML5 Canvas and requestAnimationFrame for smooth 60fps animation
  • Responsive adaptation automatically adjusting to window resize events and container changes
  • CSS blend mode compatibility working seamlessly with mix-blend-mode for creative visual effects
  • Configurable opacity control using patternAlpha parameter for precise transparency adjustment
  • TypeScript support with fully typed component interface for reliable integration
  • Performance optimized using efficient Canvas operations and minimal memory allocation
  • Flexible scaling options supporting independent horizontal and vertical scale factors

Examples

Pattern Variations

Loading component...

Use Cases

This free open source React component works well for:

  • Creative portfolios - Film grain effects adding artistic texture to photography showcases built with Next.js
  • Gaming interfaces - Atmospheric noise overlays for immersive game menus using TypeScript
  • Video applications - Vintage film effects for video editing and media players
  • Photography sites - Authentic grain textures enhancing visual storytelling using shadcn/ui design
  • Brand experiences - Textural overlays creating unique visual identity elements
  • Art galleries - Digital grain effects complementing contemporary and vintage artwork using Tailwind CSS

API Reference

NoiseProps

PropTypeDefaultDescription
patternSizenumber250Size of the noise pattern in pixels
patternScaleXnumber1Horizontal scale factor for the pattern
patternScaleYnumber1Vertical scale factor for the pattern
patternRefreshIntervalnumber2How often to refresh the pattern (in animation frames)
patternAlphanumber15Opacity of the noise pattern (0-255)
classNamestringundefinedAdditional CSS classes to apply

Implementation Notes

  • Component uses HTML5 Canvas with requestAnimationFrame for high-performance grain animation
  • Pattern size determines the base resolution of noise texture (250px default provides good balance)
  • Opacity controlled via patternAlpha parameter (0-255 range, 10-30 recommended for subtle effects)
  • Refresh interval controls animation speed (higher values = slower animation, 2 frames default)
  • Scale factors (patternScaleX/Y) allow directional grain effects and aspect ratio adjustments
  • Compatible with CSS mix-blend-mode properties (overlay, multiply, screen) for creative effects
  • Automatically adapts to window resize events and container dimension changes
  • Multiple Noise components can be layered with different settings for complex texture combinations