Skip to content

Noise Grain

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

BackgroundsHTMLCSSany framework

Copy into your project

HTML
<!-- Wrap around any element to add noise grain -->
<div class="nuda-noise-grain" aria-hidden="true">
  <!-- Your content here -->
</div>
CSS
/* Noise Grain
   Film grain texture overlay.
   Customize: opacity for intensity */

.nuda-noise-grain {
  position: relative;
  overflow: hidden;
}

.nuda-noise-grain::after {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  animation: nuda-grain-shift 0.15s steps(3) infinite;
  will-change: transform;
}

@keyframes nuda-grain-shift {
  to { transform: translate3d(-8px, 4px, 0); }
}

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

How to use Noise 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 backgrounds components

← Browse all NudaUI components