ReactHive

Colour Wash Slider

Component 6

About

A full-screen slider where three things change together: the background colour washes in from the side you're heading, the giant word behind the photo rolls out through a mask as the next rolls in, and the photo swings out as the next swings in. The photo leans to the pointer.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Colour Wash Slider to your project and fits it to your theme.

Code

How Colour Wash Slider is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { ColourWash } from "@/components/ui/colour-wash";

const settings = {
  interval: 5,
  duration: 1.1
};

/* The demo's Google Fonts. In a Next.js app, use next/font/google instead. */
if (typeof document !== "undefined" && !document.getElementById("colour-wash-fonts")) {
  const style = document.createElement("style");
  style.id = "colour-wash-fonts";
  style.textContent = "@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@100..900&display=swap'); .rh-inter-tight { font-family: 'Inter Tight', sans-serif; }";
  document.head.appendChild(style);
}

const bright = [
  {
    "name": "orange-sunglasses",
    "title": "Citrus",
    "alt": "A person in red sunglasses and a green jacket against orange",
    "caption": "Editorial, spring issue",
    "width": 1440,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/3b/3bb078492f3e6b7b2e411adcb66efb67de1d868a71023567df7e49770caf2759.webp"
  },
  {
    "name": "green-dancer",
    "title": "Green Room",
    "alt": "A blurred dancer in white against a green backdrop",
    "caption": "Motion study",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/96/96534974eb49bb0e5a352f251a69da6a4b11a6c691eaa20df96e8c21b665e569.webp"
  },
  {
    "name": "pink-blazer",
    "title": "Pink Hour",
    "alt": "A person in a pink blazer against pink",
    "caption": "Editorial, colour stories",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/3c/3cbe946fb0d67e3ea99ee0c861b1f9a4257f181200234bd461298577e3902b20.webp"
  },
  {
    "name": "yellow-walk",
    "title": "Procession",
    "alt": "A figure in a yellow robe walking, caught in a multiple exposure against orange",
    "caption": "Motion study",
    "width": 1440,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/0a/0aabcb5a22e5bc67dcb561d7b544bd52d518d3040b2f6a45e348d2c77b7e92a0.webp"
  },
  {
    "name": "red-sky",
    "title": "High Noon",
    "alt": "A person in a red outfit against a clear blue sky",
    "caption": "Editorial, summer issue",
    "width": 1800,
    "height": 1221,
    "src": "https://cdn.21st.dev/assets/mirror/88/8817490ab1af62dc8becfbc2c122b30c678b995f1e1e6fc1011538899d2f64bf.webp"
  },
  {
    "name": "spinning-dress",
    "title": "Turn",
    "alt": "A dancer spinning in a swirling, colourful dress",
    "caption": "Motion study",
    "width": 1400,
    "height": 1337,
    "src": "https://cdn.21st.dev/assets/mirror/76/760a67b082183370900b6f059af09fa02a70e18893162ab7003fafddb6a6b968.webp"
  },
  {
    "name": "magenta-hands",
    "title": "Peekaboo",
    "alt": "A person peering through yellow-painted fingers against magenta",
    "caption": "Editorial, colour stories",
    "width": 1195,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/5e/5eea8fe53aa88dd9aba2e1cbcce10d5cb3b74462d4bc28d75f714c265cafbabf.webp"
  },
  {
    "name": "orange-dancers",
    "title": "Heat",
    "alt": "Blurred dancers moving through orange light",
    "caption": "Motion study",
    "width": 1800,
    "height": 1169,
    "src": "https://cdn.21st.dev/assets/mirror/56/568de028f92375c3a70e1ec1a3755c218f95e2a7813d5bd5580195da66bebea6.webp"
  },
  {
    "name": "yellow-jacket",
    "title": "Yellow",
    "alt": "A person in a yellow and black jacket in a yellow room",
    "caption": "Editorial, menswear",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/3e/3e9a39eb7c2d9ec200ae5c009a2556580e4447f25212ee08985792e6626ecb59.webp"
  },
  {
    "name": "stage-dancers",
    "title": "Encore",
    "alt": "Dancers on a dark stage dissolving into trails of pink and blue light",
    "caption": "Motion study",
    "width": 1800,
    "height": 1376,
    "src": "https://cdn.21st.dev/assets/mirror/a4/a46338d079106c75d677588e79e0c89dd6ed83bb1cef4e891d7d0f90eba522f6.webp"
  },
  {
    "name": "green-dress",
    "title": "Orchard",
    "alt": "A person in a green dress holding an apple",
    "caption": "Editorial, autumn issue",
    "width": 1350,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/da/da1c0eb311d45b394f85d1629b83535cacb1386044c497a9bc24d83544b7fadb.webp"
  },
  {
    "name": "violet-blur",
    "title": "Afterglow",
    "alt": "A blurred figure in violet and orange light",
    "caption": "Motion study",
    "width": 1800,
    "height": 1199,
    "src": "https://cdn.21st.dev/assets/mirror/a6/a692ef8f461284b6a292a85bb4c5c284d3cbb7cab8134417e9aeb3f31abf4cee.webp"
  },
  {
    "name": "pink-pair",
    "title": "Two of Us",
    "alt": "Two people in pink sleeves, side by side",
    "caption": "Editorial, colour stories",
    "width": 1350,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/fc/fc2d20e32a94b933a2ebfb333fbbf1ceddc0a12a59403244dfdf0c1789f385de.webp"
  },
  {
    "name": "neon-crowd",
    "title": "Night Market",
    "alt": "A crowd blurred into streaks under neon lights",
    "caption": "Motion study",
    "width": 1800,
    "height": 1199,
    "src": "https://cdn.21st.dev/assets/mirror/f7/f7855a5859c4f254cec2a6a8ce3313196276bd1996b50cdb011c137abc5e6774.webp"
  },
  {
    "name": "red-suit",
    "title": "Red Line",
    "alt": "A person in a red suit against a dark backdrop",
    "caption": "Editorial, tailoring",
    "width": 1201,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/a9/a9a19a4c073cd0d7098c51866a2a1e0f4caf67c042c38c4f47101b2d9e215568.webp"
  },
  {
    "name": "beach-blur",
    "title": "Tide",
    "alt": "A blurred figure in a bright swimsuit on a beach",
    "caption": "Motion study",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/b2/b2ac414c4abb2616d3e6aa5648bfd128dd69032ba412259a0ec170b792f7187f.webp"
  },
  {
    "name": "yellow-blossom",
    "title": "Bloom",
    "alt": "A close portrait framed by yellow blossom",
    "caption": "Editorial, beauty",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/56/5617db928d7b8ef766d82c958d9125b5b4528f7bbd01876b44c12e7a36881f72.webp"
  },
  {
    "name": "hair-flip",
    "title": "Flip",
    "alt": "A person tossing their hair, in sunglasses and a pink top",
    "caption": "Editorial, summer issue",
    "width": 1800,
    "height": 1199,
    "src": "https://cdn.21st.dev/assets/mirror/01/01896b2343d03e64c0525b155db049eb63dbba24bafb214b6dee6252b5965086.webp"
  },
  {
    "name": "blue-suit",
    "title": "Blue Note",
    "alt": "A person in a blue suit sitting on white sheets against teal",
    "caption": "Editorial, tailoring",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/b2/b20736eb1c9511339d0a6dd78b1688b28479e964e741044a08c3dfa5aa7a7cb9.webp"
  },
  {
    "name": "orange-chair",
    "title": "Sit Still",
    "alt": "A person sitting on a wooden chair against orange",
    "caption": "Editorial, menswear",
    "width": 1201,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/57/5790842cde5e70321f83073b8ef3e199e7024456bbe26308f241794c8360b10c.webp"
  }
];

const type = { className: "rh-inter-tight", style: { fontFamily: "'Inter Tight', sans-serif" } };

const shot = (name: string) => bright.find((p) => p.name === name)!;
const slides = [
  { ...shot("orange-sunglasses"), word: "Zest", colour: "#f2933a", ink: "#5b2a0c" },
  { ...shot("pink-blazer"), word: "Blush", colour: "#d9a6b6", ink: "#6c2c44" },
  { ...shot("yellow-jacket"), word: "Sunny", colour: "#e8d37f", ink: "#5e4b0c" },
  { ...shot("blue-suit"), word: "Deep", colour: "#1e7680", ink: "#eefaf9" },
  { ...shot("magenta-hands"), word: "Plum", colour: "#8a3d9b", ink: "#f2cdf5" },
];

function DemoContent(props: Partial<typeof settings> = {}) {
  const v = { ...settings, ...props };
  return (
    <main className={type.className}>
      <ColourWash slides={slides} interval={Number(v.interval)} duration={Number(v.duration)} />
    </main>
  );
}

/** The demo in its own colours, filling the frame. */
export default function Demo(props: Partial<typeof settings> = {}) {
  return (
    <div className="min-h-svh w-full" style={{ background: "#f2933a" }}>
      <DemoContent {...props} />
    </div>
  );
}

More by ReactHive

View all
  • Card Deal

    Card Deal

    76
  • Step Stack

    Step Stack

    58
  • Arc Gallery

    Arc Gallery

    38
  • Fluid Type

    Fluid Type

    33
  • Card Pack

    Card Pack

    28
  • Satin

    Satin

    17
  • Flap Board

    Flap Board

    9
  • Mercury Clock

    Mercury Clock

    8

Explore more

Part of ReactHive UI — browse the full library on 21st.dev.