Wobble
Big type that won't sit still. A WebGL2 shader bends your words like jelly, so letters swell, stretch and sway as a slow field rolls through them, while their edges stay crisp.
Wobble
Installation
pnpm dlx shadcn@latest add @breeze/wobbleUsage
import { Wobble } from "@/components/breeze/wobble"Give it a box; the lettering fits itself to the box's width and height, with a little room left around it for the warp.
<Wobble text="Wobble" as="h1" className="h-56 w-full" />Use \n for more than one line:
<Wobble text={"Soft\nServe"} className="h-96 w-full" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | "Wobble" | The words; \n starts a new line |
as | string | "h2" | The element that holds the real text, e.g. "h1" or "p" |
color | string | "currentColor" | Letter colour, any CSS colour or var() |
weight | number | 800 | Font weight (best with a variable font) |
amount | number | 1 | How strongly the letters warp, 0 to 2. 0 holds them still |
scale | number | 1 | Size of the waves. Bigger is broader and lazier |
speed | number | 1 | Animation speed multiplier. 0 freezes the warp |
interactive | boolean | true | A soft bulge follows the pointer |
fps | number | 60 | Frame rate cap |
className | string | Size it here; its font and tracking are used too |
Your words are drawn once in your own font, then the shader bends the space they sit in. A few slow waves run through it in different directions, one set moving the type up and down and one side to side, so the baseline ripples, letters grow taller and shorter, and stems lean and sway. Each wave swells and fades on its own, so the motion never visibly loops. However far a letter is stretched, its edge is rebuilt one pixel wide, so it stays as sharp as text rather than smudging. It uses the font, weight and letter spacing of the element, so your font classes and tracking-* change the lettering too (with default spacing it tightens a touch, to -0.02em, to suit display type), and it's redrawn when your fonts load, the box resizes or the theme changes. The colour follows your text colour, so it's dark in light mode and light in dark mode, with a transparent background. The real text stays in the page for screen readers and search, and the plain text shows instead if WebGL2 isn't available or the browser drops the GPU context. Other props such as id, style, aria-* or data-* go on the element. It pauses off-screen and in background tabs, and shows a still frame with reduced motion.
Examples
Brand colour
Pass any CSS colour or theme token, here your primary colour.
Breeze
<Wobble
text="Breeze"
color="var(--primary)"
className="absolute inset-0 h-full w-full"
/>Slow and broad
Heat haze
<Wobble
text={"Heat\nhaze"}
weight={600}
scale={1.8}
speed={0.6}
className="absolute inset-0 h-full w-full tracking-tight"
/>