# Linear Flow

A linear blend whose angle and colour stops drift slowly. The quietest kind: good behind dense content.

Source: https://gradients.sh/docs/components/linear-flow

## Installation

```bash
npx shadcn@latest add https://gradients.sh/r/linear-flow.json
```

## Usage

```tsx
import { LinearFlow } from "@/components/linear-flow";

<LinearFlow className="h-[480px]">{children}</LinearFlow>;
```

The gradient fills its box, so give it a height. Children render on top. [Animated gradient backgrounds in Tailwind CSS](https://gradients.sh/blog/tailwind-animated-gradient) compares it with pure CSS approaches, and [Linear gradients in CSS](https://gradients.sh/blog/linear-gradient-css) explains the gradient line it shares with CSS.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | `—` | Content layered on top of the gradient. |
| `colors` | `[string, string, ...string[]]` | `["#c13b3b", "#140a0e", "#2c55c5", "#eef2ff"]` | Two to six colours: hex, oklch(), names or var(--token). |
| `background` | `string` | `"#06070c"` | Base colour under the gradient. |
| `speed` | `number` | `0.5` | 0 to 2. How fast the gradient moves. 0 holds it still. |
| `loopSeconds` | `number` | `18` | 4 to 30. The animation repeats exactly every loopSeconds. |
| `scale` | `number` | `1` | 0.25 to 4. Noise frequency: higher means smaller shapes. |
| `warp` | `number` | `0.22` | 0 to 1. Domain-warp strength. |
| `grain` | `number` | `0.08` | 0 to 1. Film grain. |
| `blur` | `number` | `0.5` | 0 to 1. Softness. |
| `seed` | `number` | `21` | Integer seed for the noise field. |
| `dither` | `{ enabled?: boolean; cell?: number; levels?: number }` | `{ enabled: false, cell: 3, levels: 8 }` | Ordered 4×4 Bayer dither. |
| `interaction` | `{ pointer?: number; scroll?: number }` | `{ pointer: 0.15, scroll: 0.15 }` | 0 to 1 influence of the pointer and of scroll velocity. |
| `maxDpr` | `number` | `1.5` | Device pixel ratio cap for the canvas. |
| `reducedMotion` | `"respect" \| "ignore"` | `"respect"` | "respect" shows one still frame when the user prefers reduced motion. |
| `className` | `string` | `—` | Classes for the outer element. Size it here; the gradient fills it. |
