Baktiyar Ablaikhan

Text Reveal Card

Source
Aceternity UI ↗
Author
Aceternity UI
Licence
Aceternity UI licence (free component)

Loading…

Moving the pointer across the card wipes away one line to reveal a hidden one, over drifting stars.

Code

"use client";
import {
  TextRevealCard,
  TextRevealCardDescription,
  TextRevealCardTitle,
} from "@/lab/aceternity/ui/text-reveal-card";

export default function TextRevealCardPreview() {
  return (
    <div className="relative flex h-full w-full items-center justify-center bg-[#0E0E10] p-[4%]">
      <TextRevealCard
        text="You know the business"
        revealText="I know the chemistry "
        className="w-full max-w-[40rem] p-[clamp(1rem,4%,2rem)]"
      >
        <TextRevealCardTitle className="text-[clamp(0.8rem,3cqw,1.125rem)]">
          Sometimes, you just need to see it.
        </TextRevealCardTitle>
        <TextRevealCardDescription className="text-[clamp(0.65rem,2.2cqw,0.875rem)]">
          This is a text reveal card. Hover over the card to reveal the hidden text.
        </TextRevealCardDescription>
      </TextRevealCard>
    </div>
  );
}
Prompt

Build "Text Reveal Card", a card animation. What it does: Moving the pointer across the card wipes away one line to reveal a hidden one, over drifting stars. Write it as a single self-contained React component in TypeScript that fills its parent (w-full h-full), styled with Tailwind CSS, using motion, tailwind-merge. Technique: the Motion library, pointer tracking. It sits on a dark background, in a 16:10 frame. Respect prefers-reduced-motion with a still state, pause work when the element is off screen, and keep it accessible. Original: https://ui.aceternity.com/components/text-reveal-card (Aceternity UI, Aceternity UI licence (free component)).