Readout
A WebGL2 shader that draws a slow wave, an arch or an inverted arch entirely in pixel digits. The digits stay put while light and colour flow smoothly through them.
Installation
pnpm dlx shadcn@latest add @breeze/readoutUsage
import { Readout } from "@/components/breeze/readout"It fills a hero or a section as its background. It's transparent, so your page colour shows through between the digits. The canvas fills its box: put it in a positioned parent that has a size, as below, or give it a height of its own. In a box with no height it's 0 tall.
<section className="relative isolate overflow-hidden">
<Readout className="absolute inset-0 -z-10 h-full w-full" />
{/* content */}
</section>Props
| Prop | Type | Default | Description |
|---|---|---|---|
shape | "waves" | "arch" | "inverted" | "waves" | Rolling waves, an arch, or an inverted arch |
color | string | "#3d6bff" | Colour of the depths, any CSS colour or var() |
accentColor | string | "var(--foreground)" | Colour of the edge and its glow |
speed | number | 0.5 | Animation speed multiplier. 0 freezes the wave |
waveHeight | number | 1 | Multiplies the height of the swells (waves only) |
level | number | 0.38 | Where the surface sits, 0 (top) to 1 (bottom) |
glow | number | 1 | Strength of the glow along the edge |
smoke | number | 1 | Amount of smoke drifting through the background. 0 turns it off |
dotSize | number | 2 | Size of one glyph dot in CSS px. A digit is 4 × 6 dots |
strength | number | 1 | Ink opacity multiplier (capped at full opacity) |
fps | number | 40 | Frame rate cap |
Each digit is a 3 × 5 dot glyph drawn in the shader, so there's no font to load and the dots stay crisp at any size. The digit is the value at that spot, from a dim 0 up to a bright 9 along the edge. waves fills below a rolling surface. arch is a half circle standing on the bottom edge across the full width, meeting both corners, with the digits filling the space around it and the arch itself left open for your content. inverted is the same, hanging from the top edge. On narrow, tall frames like a phone, the circle grows wider than the frame, so you see a gentle curve near the top running off both sides, with the digits in the band above it. Both are clean, perfectly round curves at any size, cut smoothly through the digits. The digits never change: a smooth field flows through them, brightening, dimming and shifting between your two colours, over a soft wash and a glow along the edge, with slow smoke curling up through the background that the digits catch as it passes. The crest follows your text colour by default, so it's light in dark mode and dark in light mode. Every prop updates live, the animation pauses off-screen and it shows a still frame with reduced motion.
Any other canvas prop, like id, style or data-*, is passed to the canvas. It's aria-hidden unless you override it.
Examples
Arch
<Readout shape="arch" className="absolute inset-0 h-full w-full" />Inverted arch
<Readout shape="inverted" className="absolute inset-0 h-full w-full" />