Text Reveal
NewWords brighten as you scroll through a paragraph, in the page or any scroll container, or once on view.
Scroll down ↓
Components you copy into your project and own. Read every line, change anything, and keep it in step with updates when you want them.
Installation
$ pnpm dlx shadcn@latest add @synccn/text-revealFirst time in this project? Connect synccn with one command.
Usage
import { TextReveal } from "@/components/ui/text-reveal";<TextReveal text="Components you own." />API reference
Generated from the component's TypeScript types, so it always matches the code.
TextReveal
Paragraph whose words brighten as you scroll through it (or once, when it comes into view). Works in the page or inside any scrolling container. Static with reduced motion.
- textrequired
stringThe text. Words light up one after another.
- trigger
"scroll" | "view"Default
"scroll""scroll" ties the reveal to scrolling; "view" plays it once when the text comes into view.
- duration
numberDefault
1.6Seconds for the whole reveal, with trigger "view".
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
Accessibility
- Screen readers get the full sentence at once; reduced motion shows it fully lit.
From the source
Read from this component's code when the site builds, so it can't drift.
- Respects the reduced motion setting
- Includes text only screen readers hear