Linear Flow

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

Keep it moving

Installation

pnpm dlx shadcn@latest add https://gradients.sh/r/linear-flow.json

Usage

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 compares it with pure CSS approaches, and Linear gradients in CSS explains the gradient line it shares with CSS.

Props

PropTypeDefault
children

Content layered on top of the gradient.

ReactNode—
colors

Two to six colours: hex, oklch(), names or var(--token).

[string, string, ...string[]]["#c13b3b", "#140a0e", "#2c55c5", "#eef2ff"]
background

Base colour under the gradient.

string"#06070c"
speed

0 to 2. How fast the gradient moves. 0 holds it still.

number0.5
loopSeconds

4 to 30. The animation repeats exactly every loopSeconds.

number18
scale

0.25 to 4. Noise frequency: higher means smaller shapes.

number1
warp

0 to 1. Domain-warp strength.

number0.22
grain

0 to 1. Film grain.

number0.08
blur

0 to 1. Softness.

number0.5
seed

Integer seed for the noise field.

number21
dither

Ordered 4×4 Bayer dither.

{ enabled?: boolean; cell?: number; levels?: number }{ enabled: false, cell: 3, levels: 8 }
interaction

0 to 1 influence of the pointer and of scroll velocity.

{ pointer?: number; scroll?: number }{ pointer: 0.15, scroll: 0.15 }
maxDpr

Device pixel ratio cap for the canvas.

number1.5
reducedMotion

"respect" shows one still frame when the user prefers reduced motion.

"respect" | "ignore""respect"
className

Classes for the outer element. Size it here; the gradient fills it.

string—