Grainy Background

Animated gradient background with film grain texture, multiple colorways, and variable intensity.

Six animations. Six grains. Infinite combos.

Animated mesh gradients with film-grain textures. Mix and match animation styles and grain types for unique backgrounds.

Aurora · Plasma
Grainy gradients

Animated mesh backgrounds with film-grain textures.

Mesh
Paper

Soft fibrous texture.

Dust
Pulse

Breathing concentric rings.

Noise
Waves

Rolling horizontal bands.

Scratches
Spiral

Counter-rotating spirals.

Digital
Flow

Drifting radial blobs.

Mesh · Digital
Blend modes

Connected mesh nodes.

Grainy Background overlays a fine animated film grain texture on top of a slow-moving gradient, giving flat sections the weight of analog photography. Grain size, density, and animation speed are configurable, and the output is pure CSS so it scales to any container. Built with React and Tailwind CSS. Excellent for hero sections, marketing pages, and video-adjacent layouts that need texture.

Installation

Usage

import { GrainyBackground } from "@/components/ui/grainy-background";
<div className="relative h-[500px] w-full overflow-hidden bg-transparent">
  <div className="absolute inset-0">
    <GrainyBackground
      className="absolute inset-0"
      colors={["#3b82f6", "#2563eb", "#1d4ed8", "#1e40af"]}
    />
  </div>
  <div className="relative z-10 flex h-full items-center justify-center text-white">
    <div className="p-4 text-center">Animated Background</div>
  </div>
</div>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeundefinedContent to render on top of the gradient background.
classNamestringundefinedAdditional CSS classes to apply to the container. Use this to control size, position, and z-index.
styleReact.CSSPropertiesundefinedInline styles to apply to the container.
colorsstring[]DEFAULT_COLORSArray of colors to use in the gradient pattern.
speednumber1Speed factor for the gradient animation (higher = faster).
grainTypestring"digital"Type of grain texture effect: digital (sharp pixelated), plasma (organic flowing), scratches (linear streaks), paper (smooth textured), noise (fine random), dust (scattered particles).
grainIntensitynumber60Intensity of the grain effect (0-100).
grainSizenumber100Size of the grain particles.
animationTypestring"mesh"Animation pattern effect: flow (smooth directional), mesh (interconnected nodes), waves (rhythmic undulation), aurora (curtain-like movement), spiral (circular rotation), pulse (concentric expansion).
animatebooleantrueEnable or disable background animation.
grainBlendModestring"soft-light"CSS blend mode effect for grain layer: multiply (darkens), overlay (contrast), soft-light (gentle), hard-light (intense), screen (brightens), color-burn (dramatic), normal (standard).

Examples

Hero Section

Start building today.

Install the registry, pick a component, ship it. No setup, no config, no friction.