Components
Animated text that reveals with a vertical split effect, sliding each half in from the center on mount.
Loading preview...
"use client";
import * as React from "react";
import { TextSplitReveal } from "@/components/ui/text-split-reveal";
export default function TextSplitRevealDemo() {
const [key, setKey] = React.useState(0);
return (
<div className="flex min-h-[360px] w-full flex-col items-center justify-center gap-8 bg-background px-6 py-16 text-foreground">
<div key={key} className="flex flex-col items-center gap-3 text-center">
<TextSplitReveal className="text-5xl font-bold tracking-tight sm:text-6xl">
Split Reveal
</TextSplitReveal>
<TextSplitReveal delay={0.2} className="text-lg text-muted-foreground">
Animated text that unfolds from the center.
</TextSplitReveal>
</div>
<button
onClick={() => setKey((k) => k + 1)}
className="rounded-full border border-border px-5 py-2 text-sm font-medium transition-colors hover:bg-muted"
>
Replay
</button>
</div>
);
}