Scroll Stir

A topographic map that swirls when the page scrolls fast.

Scroll Stir behind a stats section
Still frame

Installation

pnpm dlx shadcn@latest add @gradients-pro/scroll-stir

Needs 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

PropTypeDefaultDescription
palette"ultramarine" | "ember" | "mono""ultramarine"A curated ramp that follows light and dark mode. Ignored when colors is set.
colorsstring[]none2 to 6 CSS colours from the lowest ground to the highest peaks.
backgroundstringvar(--background)The ground colour.
stirnumber10 to 1. How hard a fast scroll twists the terrain; 0 turns scroll reactions off.
densitynumber10.25 to 4. More, smaller hills at higher values.
softnessnumber0.30 to 1. Fainter elevation shading.
speednumber0.40 to 2. How fast the terrain drifts.
scheme"light" | "dark"follows the pageForces the palette's colour scheme. By default it reads a dark or light class (or data-theme) on <html>, then the system setting.
paramsPartial<GradientParams>noneAny other engine param, applied last.
className, styleThe outer box. Give it a size.
childrenReactNodenoneDrawn above the map.