A white panel with a soft wash of blue and yellow that slides from side to side. Good behind an availability note or a call to hire.
How to use
Make two files in your project's components folder: moving-gradient.tsx and moving-gradient.module.css.
Paste the code into each one, keeping the licence note at the top of the component.
It needs nothing beyond React. Your project needs CSS Modules, which Next.js and Vite already have.
Import it where you want it, then change the words, colours and sizes to yours.
The code
import type { ComponentPropsWithoutRef } from "react";
import styles from "./moving-gradient.module.css";
interface MovingGradientProps extends ComponentPropsWithoutRef<"div"> {
/** Let the colours drift from side to side. */
animated?: boolean;
/** The three colours of the wash, left to right. Keep to one or two palette colours with white between. */
colors?: [string, string, string];
/** How strong the wash is, 0 to 1. */
opacity?: number;
/** Seconds for one pass across. */
speed?: number;
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
import type { ComponentPropsWithoutRef } from "react";
import styles from "./moving-gradient.module.css";
interface MovingGradientProps extends ComponentPropsWithoutRef<"div"> {
/** Let the colours drift from side to side. */
animated?: boolean;
/** The three colours of the wash, left to right. Keep to one or two palette colours with white between. */
colors?: [string, string, string];
/** How strong the wash is, 0 to 1. */
opacity?: number;
/** Seconds for one pass across. */
speed?: number;
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.