WaveText
Kinetic text that answers the cursor — each letter lifts, scales and warms as you pass over it.
Live — this one is real
Move across the word — each letter answers
Usage
import { WaveText } from "mizu-ui";
export function Title() {
return (
<WaveText
text="Mizu"
as="h1"
radius={120}
style={{ margin: 0, fontSize: 72, fontWeight: 900 }}
/>
);
}
Source & setup
Add this component to your project with the shadcn CLI. The command copies its source into your configured UI directory, with base.css, Mizu’s tokens, and the stylesheets that hold its rules. Each rule lives in one stylesheet, so components you add together never repeat CSS. In a project without a components.json, run npx shadcn@latest init 0xuser64bit/mizu/preset first: plain init installs shadcn’s theme into your global CSS. Then load the fonts.
npx shadcn@latest add 0xuser64bit/mizu/wave-textEvery component imports from its own path, its name in kebab case. To paste the example, replace its mizu-ui import with:
import { WaveText } from "@/components/ui/mizu/wave-text";For npm imports, import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Requires React and Motion. A Client Component: its source starts with “use client”.
Inspect type/WaveText.tsx
Source is included in the npm package under src/type/WaveText.tsx.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | — | The word or phrase. |
| radius | number | 120 | Pointer influence radius in px. |
| colorFrom / colorTo | string | "var(--mizu-paper)" / "var(--mizu-accent)" | Resting and active letter colors, any CSS color. The defaults follow the theme. |
| as | "span" | "h1" | "h2" | "p" | "div" | "span" | Semantic element to render. |
Accessibility
Letters are aria-hidden; the container carries the full text as its accessible name.
Motion
Direct motion values with smoothstep falloff. Reduced motion removes pointer listeners and keeps letters at rest.