# Scroll Stir

A topographic map that swirls when the page scrolls fast.

Source: https://gradients.sh/docs/pro/scroll-stir

## Installation

```bash
npx gradients.sh add scroll-stir
```

Pro: this needs a Pro account. The first run on a computer prints a login link for the user to approve, then you run it again. Details: https://gradients.sh/docs/pro.md.

## Usage

```tsx
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.                                                                                                                      |
