Scroll Stir
A topographic map that swirls when the page scrolls fast.

import { ScrollStir } from "@/components/scroll-stir";
export function Hero() {
return (
<ScrollStir className="flex h-[560px] items-end p-10">
<h1 className="text-5xl font-semibold tracking-tight text-white">
A few kilobytes, not a video
</h1>
</ScrollStir>
);
}
Installation
pnpm dlx shadcn@latest add @gradients-pro/scroll-stirNeeds a Pro account and the Pro registry setup.
Usage
import { ScrollStir } from "@/components/scroll-stir";
<ScrollStir className="h-[560px]">{children}</ScrollStir>;It fills its box, so give it a height. Children render on top.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
palette | "ultramarine" | "ember" | "mono" | "ultramarine" | A curated ramp that follows light and dark mode. Ignored when colors is set. |
colors | string[] | none | 2 to 6 CSS colours from the lowest ground to the highest peaks. |
background | string | var(--background) | The ground colour. |
stir | number | 1 | 0 to 1. How hard a fast scroll twists the terrain; 0 turns scroll reactions off. |
density | number | 1 | 0.25 to 4. More, smaller hills at higher values. |
softness | number | 0.3 | 0 to 1. Fainter elevation shading. |
speed | number | 0.4 | 0 to 2. How fast the terrain drifts. |
scheme | "light" | "dark" | follows the page | Forces the palette's colour scheme. By default it reads a dark or light class (or data-theme) on <html>, then the system setting. |
params | Partial<GradientParams> | none | Any other engine param, applied last. |
className, style | The outer box. Give it a size. | ||
children | ReactNode | none | Drawn above the map. |
