Each letter drops into place a beat after the one before, coming out of a slight blur. Made for the first line of a home page.
How to use
Make two files in your project's components folder: wave-reveal.tsx and wave-reveal.module.css.
Paste the code into each one, keeping the licence note at the top of the component.
It needs nothing beyond React. Your project needs CSS Modules, which Next.js and Vite already have.
Import it where you want it, then change the words, colours and sizes to yours.
The code
import { Fragment, type CSSProperties, type ReactNode } from "react";
import styles from "./wave-reveal.module.css";
interface WaveRevealProps {
/** The text to animate. */
text: string;
/** A class for the wrapper: size, weight, colour, alignment. */
className?: string;
/** Inline style for the wrapper, e.g. { fontSize: 84 }. */
style?: CSSProperties;
/** Which way each letter or word travels as it appears. */
direction?: "up" | "down";
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
import { Fragment, type CSSProperties, type ReactNode } from "react";
import styles from "./wave-reveal.module.css";
interface WaveRevealProps {
/** The text to animate. */
text: string;
/** A class for the wrapper: size, weight, colour, alignment. */
className?: string;
/** Inline style for the wrapper, e.g. { fontSize: 84 }. */
style?: CSSProperties;
/** Which way each letter or word travels as it appears. */
direction?: "up" | "down";
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.