Dither Wave
A sea of color whose edge breaks into dots on a slow tide.
Overview
Dither Wave fills the top of a section with color and lets its lower edge break into a grid of dots. The edge rises and falls like a slow tide, with a paler line of foam moving a little behind it.
It is drawn with SVG filters instead of a canvas, so it needs no WebGL and appears with the first paint of a server-rendered page. The wave stretches to its container while the dots keep their size. The area below the wave uses your page background, so it blends into the section that follows in light and dark themes.
Use it as a hero with the heading over the solid part of the wave, or as the top of a launch page.
Installation
Usage
import { DitherWave } from "honestui/shaders"
<DitherWave className="min-h-[600px]">
<div className="px-8 pt-26 text-center text-white">
<h1 className="text-4xl leading-[1.06] font-medium tracking-[-0.04em] sm:text-[52px]">
Ship on calm water.
</h1>
<p className="mx-auto mt-4 max-w-95 text-[15px] leading-normal">
Plan, review, and release from one place.
</p>
</div>
</DitherWave>Colors
color is the sea; its darker and paler tones are mixed from it. backgroundColor is the area below. Both accept any CSS color, including custom properties.
<DitherWave color="var(--primary)" backgroundColor="var(--card)" className="h-96" />Accessibility
Dither Wave is decorative and its drawing is hidden from assistive technology. Keep text and actions in normal HTML, in roughly the upper third where the color is solid, and check their contrast against your color.
The tide stops when the user prefers reduced motion, and the wave stays in place.