Skip to content

WaveText

Kinetic text that answers the cursor — each letter lifts, scales and warms as you pass over it.

Live — this one is real

Text

Move across the word — each letter answers

Usage

tsx
import { WaveText } from "mizu-ui";

export function Title() {
  return (
    <WaveText
      text="Mizu"
      as="h1"
      radius={120}
      colorFrom="#f4f0e8"
      colorTo="#ff4d1c"
    />
  );
}

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: it styles itself inline and brings no stylesheet of its own. 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.

sh
npx shadcn@latest add 0xuser64bit/mizu/wave-text

Every component imports from its own path, its name in kebab case.

tsx
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.

Open full source ↗

Props

PropTypeDefaultDescription
textstring—The word or phrase.
radiusnumber120Pointer influence radius in px.
colorFrom / colorTostring"var(--mizu-paper)" / "var(--mizu-accent)"Resting and active letter colors.
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.

Works alongside