For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. The dithercn agent skill, for building any dither on the engine, is at /.well-known/agent-skills/dithercn/SKILL.md.
dithercn

Ridgelines

Stacked ridge lines like a pulsar plot, each hiding the ones behind it, drawn as a dither.

Controls
Colour
Lines32
Amplitude1
Animate

Installation

pnpm dlx shadcn@latest add https://dithercn.dev/r/ridgelines.json

Usage

import { Ridgelines } from "@/components/dithercn/ridgelines";
 
export function Section() {
  return (
    <section className="relative isolate min-h-[420px]">
      <Ridgelines className="absolute inset-0 -z-10" />
    </section>
  );
}

Each line is flat at the ends and peaked in the middle, and each one hides the lines behind it. The peaks shift slowly. A faint shade under the tallest peaks makes them read as solid ridges. Lines stay one cell wide and at least four cells apart, so a short box draws fewer of them.

Examples

In a card

Fewer lines, a narrower spread and small cells fit a pulsar plot in a card.

Mountain range

spread={1} raises peaks across the whole width. A lower amplitude keeps them low, and a three-colour palette shades the slopes.

Props

PropTypeDefault
lines

How many lines, from 6 to 64. A short box draws fewer.

Type: numberDefault 32
amplitude

Height of the peaks. 2 is twice as tall.

Type: numberDefault 1
spread

Width of the peaked band, as a share of the box, from 0.1 to 1.

Type: numberDefault 0.5
shade

Faint tone under the raised peaks, from 0 to 0.5. 0 keeps only the lines.

Type: numberDefault 0.25
palette

Colours from paper to ink: palette names such as "blue", CSS variable names, or any CSS colour.

Type: [DitherColor, DitherColor, ...DitherColor[]]Default ["--dither-paper", "--dither-ink"]
matrix

The threshold pattern. See Dither engine.

Type: "bayer2" | "bayer4" | "bayer8" | "blue-noise"Default "bayer4"
cell

Size of one dither cell in CSS pixels.

Type: numberDefault --dither-cell
speed

How fast it moves.

Type: numberDefault 1
animate

false draws one still frame.

Type: booleanDefault true
className

Size and position. The background fills this box.

Type: stringDefault –

Notes

  • It is decorative and hidden from assistive technology. Put real text on top of it, not inside it.
  • With reduced motion turned on, it draws one still frame and stops.
  • It pauses when scrolled out of view or when the tab is hidden, and releases its WebGL context when far offscreen. Without WebGL it shows thin CSS lines in the same colours.
  • It costs one small draw per frame at 30 fps, at one pixel per dither cell. See Performance.