About
A dock of tiles lit from behind by a WebGL glow that travels to the active tile and blends into its three-colour palette; arrow keys move it. Respects prefers-reduced-motion.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Shader Tint to your project and fits it to your theme.
Code
How Shader Tint is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import { Feather, Flame, Leaf, Waves } from "lucide-react";
import { useEffect, useState } from "react";
import Component, { type ShaderTintItem } from "@/components/ui/shader-tint";
const ITEMS: ShaderTintItem[] = [
{
id: "ember",
label: "Ember",
mark: <Flame aria-hidden className="size-6 text-foreground" />,
palette: ["#ff7a59", "#ff4fa3", "#8b5cf6"],
},
{
id: "tide",
label: "Tide",
mark: <Waves aria-hidden className="size-6 text-foreground" />,
palette: ["#335cff", "#3fb6ff", "#7c5cff"],
},
{
id: "grove",
label: "Grove",
mark: <Leaf aria-hidden className="size-6 text-foreground" />,
palette: ["#2fd5a0", "#9be15d", "#3aa0ff"],
},
{
id: "dune",
label: "Dune",
mark: <Feather aria-hidden className="size-6 text-foreground" />,
palette: ["#ffb020", "#ff5a36", "#e0368a"],
},
];
// The shader blends differently on light and dark surfaces, so follow the page theme.
function useIsDark() {
const [dark, setDark] = useState(false);
useEffect(() => {
const root = document.documentElement;
const read = () => setDark(root.classList.contains("dark"));
read();
const observer = new MutationObserver(read);
observer.observe(root, { attributeFilter: ["class"], attributes: true });
return () => observer.disconnect();
}, []);
return dark;
}
export default function DemoOne() {
const dark = useIsDark();
const [active, setActive] = useState("ember");
// Walk the palette so the cover catches the light moving between tiles.
useEffect(() => {
const id = setInterval(() => {
setActive((current) => {
const index = ITEMS.findIndex((item) => item.id === current);
return ITEMS[(index + 1) % ITEMS.length].id;
});
}, 1800);
return () => clearInterval(id);
}, []);
return (
<div className="flex min-h-[520px] w-full items-center justify-center bg-background p-10">
<div className="origin-center scale-[2.6]">
<Component
activeId={active}
dark={dark}
items={ITEMS}
label="Accent"
onActiveChange={setActive}
/>
</div>
</div>
);
}














