ReactHive

Whirlwind

Text 3

About

A paragraph that arrives on the wind. A tornado made of its own letters travels along the lines, flinging each letter into place in reading order, so the text writes itself in a storm. Point at a sentence and its letters lift into a small twister that follows the pointer.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Whirlwind to your project and fits it to your theme.

Code

How Whirlwind is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import type { ReactNode } from "react";

import { Whirlwind } from "@/components/ui/whirlwind";

const settings = {
  duration: 3.2,
  width: 0.22
};

/* The demo's Google Fonts. In a Next.js app, use next/font/google instead. */
if (typeof document !== "undefined" && !document.getElementById("whirlwind-fonts")) {
  const style = document.createElement("style");
  style.id = "whirlwind-fonts";
  style.textContent = "@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@100..900&family=Newsreader:wght@200..800&display=swap'); .rh-inter-tight { font-family: 'Inter Tight', sans-serif; } .rh-newsreader { font-family: 'Newsreader', serif; }";
  document.head.appendChild(style);
}

/** A gentle entrance: rises and fades in, a beat after `delay` seconds. */
function Rise({ children, delay = 0, className = "" }: { children: ReactNode; delay?: number; className?: string }) {
  return (
    <div className={className} style={{ animation: `rh-rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) ${delay}s both` }}>
      <style>{`@keyframes rh-rise { from { opacity: 0; transform: translateY(28px); } } @media (prefers-reduced-motion: reduce) { @keyframes rh-rise { from { opacity: 0; } } }`}</style>
      {children}
    </div>
  );
}

const serif = { className: "rh-newsreader", style: { fontFamily: "'Newsreader', serif" } };
const type = { className: "rh-inter-tight", style: { fontFamily: "'Inter Tight', sans-serif" } };

// Kept outside the component, so the text isn't split again on every render.
const ESSAY = `The wind never asks where you were going. It takes the hat, the map, the letter you meant to post, and sets them down somewhere you would never have thought to look.

We spent a year following it across the plains with a notebook and a kite. These are the field notes, in the order the weather gave them to us.`;

function DemoContent(props: Partial<typeof settings> = {}) {
  const v = { ...settings, ...props };
  return (
    <main className={`${type.className} min-h-svh overflow-hidden bg-[#e6ebef] px-[6vw] pt-[clamp(8rem,26vh,16rem)] pb-[14vh] text-[#1b222d]`}>
      <div className="mx-auto max-w-[56rem]">
        <Rise>
          <p className="text-[15px] font-medium text-[#1b222d]/70">Field Notes on Wind, chapter one</p>
        </Rise>
        <Whirlwind key={`${v.duration}${v.width}`} text={ESSAY} duration={Number(v.duration)} width={Number(v.width)} className={`${serif.className} mt-6 cursor-default text-[clamp(1.45rem,2.9vw,2.6rem)] leading-[1.22] tracking-[-0.01em]`} />
        <Rise delay={0.4}>
          <p className="mt-12 text-[15px] text-[#1b222d]/65">Point at a sentence to stir it up.</p>
        </Rise>
      </div>
    </main>
  );
}

/** The demo in its own colours, filling the frame. */
export default function Demo(props: Partial<typeof settings> = {}) {
  return (
    <div className="min-h-svh w-full" style={{ background: "#e6ebef" }}>
      <DemoContent {...props} />
    </div>
  );
}

More by ReactHive

View all
  • Card Deal

    Card Deal

    289
  • Arc Gallery

    Arc Gallery

    194
  • Fluid Type

    Fluid Type

    174
  • Step Stack

    Step Stack

    120
  • Iris Scroll

    Iris Scroll

    95
  • Card Pack

    Card Pack

    73
  • Word Drum

    Word Drum

    58
  • Colour Wash Slider

    Colour Wash Slider

    49

More in Text

View all
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    135
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    14
  • Scroll Fill Headline

    Scroll Fill Headline

    67
  • Blur Reveal

    Blur Reveal

    400
  • Apple Hello Effect

    Apple Hello Effect

    692
  • Rainbow Text Effect

    Rainbow Text Effect

    61
  • Text Reveal

    Text Reveal

    31
  • Vapour Text Effect

    Vapour Text Effect

    2.1K

Explore more

Part of ReactHive UI — browse the full library on 21st.dev.