Text Reveal Box Demo
sora-ui/demo-text-reveal-boxFreeComponent
Scroll-pinned manifesto copy with word-by-word highlight reveal.
Install it
npx shadcn@latest add https://ui.soralabs.io.vn/r/demo-text-reveal-box.jsonSource
1"use client";23import { useEffect, useRef, useState } from "react";4import { CatalogScrollHint } from "@/components/catalog/catalog-scroll-hint";5import { resolveScrollRoot } from "@/lib/catalog/resolve-scroll-root";6import { waitForScrollerReady } from "@/lib/scroll/scroller-ready";7import { TextRevealBox } from "@/components/sora-ui/texts/text-reveal-box";89const PARAGRAPHS = [10 "We work at the intersection of systems design and psychological tension. Every project ships only when the player feels watched from the first frame and never fully shakes it after the last.",11];1213export default function TextRevealBoxExample() {14 const rootRef = useRef<HTMLDivElement>(null);15 const [scroller, setScroller] = useState<Element | Window | undefined>();1617 useEffect(() => {18 const node = rootRef.current;19 if (!node) {20 return;21 }2223 const resolved = resolveScrollRoot(node);2425 waitForScrollerReady(resolved)26 .then(() => {27 setScroller(resolved);28 })29 .catch(() => {30 /* preview unmounted */31 });32 }, []);3334 return (35 <div className="w-full" ref={rootRef}>36 <CatalogScrollHint label="Scroll to reveal text word by word" />3738 {scroller ? (39 <TextRevealBox40 classNames={{41 paragraph:42 "text-[clamp(1.5rem,2.5vw,4.5rem)] font-medium leading-none tracking-[-0.02em]",43 }}44 containerQuery45 embedded46 paragraphs={PARAGRAPHS}47 pinDuration={4}48 scroller={scroller}49 variant="minimal"50 />51 ) : null}52 </div>53 );54}
What it pulls in
Other registry items
Files it writes
More from Sora UI
All 97 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | Sora UI | Components | Free | 2 deps | |
| Border Trailborder-trail | Sora UI | Components | Free | 1 dep | |
| Bottom Sheetbottom-sheet | Sora UI | Components | Free | 2 deps | |
| Cursor Bubblecursor-bubble | Sora UI | Components | Free | 2 deps | |
| Cursor Trail Revealcursor-trail-reveal | Sora UI | Components | Free | 1 dep | |
| Custom Cursorcustom-cursor | Sora UI | Components | Free | 2 deps | |
| Accordion Demodemo-accordion | Sora UI | Components | Free | no deps | |
| Border Trail Demodemo-border-trail | Sora UI | Components | Free | no deps |
