Skip to content

Film Grain

A copy-paste noise & grain component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Noise & GrainHTMLCSSany framework
Film Grain

Copy into your project

HTML
<!-- Film Grain — animated SVG-noise overlay -->
<div class="nuda-grain-overlay">
  <div class="nuda-grain-overlay__content">Film Grain</div>
  <div class="nuda-grain-overlay__noise" aria-hidden="true"></div>
</div>
CSS
.nuda-grain-overlay {
  position: relative;
  width: 100%;
  max-width: 220px;
  height: 130px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg,#09090b,#1c1c22);
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.nuda-grain-overlay__content {
  font-family: ui-sans-serif,system-ui,sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #e4ff54;
}

.nuda-grain-overlay__noise {
  position: absolute;
  inset: -100%;
  width: 300%;
  height: 300%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: .5;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: _grainOverlayShift .6s steps(6) infinite;
}

@keyframes _grainOverlayShift {
  0% {
    transform: translate3d(0,0,0);
  }
  20% {
    transform: translate3d(-12px,8px,0);
  }
  40% {
    transform: translate3d(8px,-10px,0);
  }
  60% {
    transform: translate3d(-8px,-6px,0);
  }
  80% {
    transform: translate3d(10px,10px,0);
  }
  100% {
    transform: translate3d(0,0,0);
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-grain-overlay__noise {
    animation: none;
  }
}

How to use Film Grain

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More noise & grain components

← Browse all NudaUI components