Baktiyar Ablaikhan

Noise Background

Source
Aceternity UI ↗
Author
Aceternity UI
Licence
Aceternity UI licence (free component)

Loading…

Coloured gradients wander behind a grainy noise layer around a pill button.

Code

"use client";
import React from "react";
import { NoiseBackground } from "@/lab/aceternity/ui/noise-background";
import { FitStage } from "./_fit-g2";

export default function NoiseBackgroundDemo() {
  return (
    <FitStage width={300} height={190} maxScale={2.2}>
      <div className="flex h-full w-full items-center justify-center">
        <NoiseBackground
          containerClassName="w-fit p-2 rounded-full mx-auto"
          gradientColors={[
            "rgb(255, 100, 150)",
            "rgb(100, 150, 255)",
            "rgb(255, 200, 100)",
          ]}
        >
          <button
            type="button"
            className="h-full w-full cursor-pointer rounded-full bg-linear-to-r from-neutral-100 via-neutral-100 to-white px-4 py-2 text-black shadow-[0px_2px_0px_0px_var(--color-neutral-50)_inset,0px_0.5px_1px_0px_var(--color-neutral-400)] transition-all duration-100 active:scale-98 dark:from-black dark:via-black dark:to-neutral-900 dark:text-white dark:shadow-[0px_1px_0px_0px_var(--color-neutral-950)_inset,0px_1px_0px_0px_var(--color-neutral-800)]"
          >
            Start publishing &rarr;
          </button>
        </NoiseBackground>
      </div>
    </FitStage>
  );
}
Prompt

Build "Noise Background", a background animation. What it does: Coloured gradients wander behind a grainy noise layer around a pill button. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion. Technique: the Motion library. It sits on a light background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/noise-background (Aceternity UI, Aceternity UI licence (free component)).