Scroll and the words fill in, one after another.

Scroll reveal

Text that fills in word by word as you scroll it into view.

Behaviour

  • Every word starts faint and turns solid in reading order.
  • Finishes when the text is centred on screen.
  • Reduced motion: the whole text is solid.

Props

PropTypeDescription
textstringThe text to reveal.
classNamestringdefault text-4xl … lg:text-7xlSize and weight of the text.
offset[string, string]default ["start 0.8", "start 0.15"]When the fill starts and ends, as scroll offsets.
containerRefObject<HTMLElement>Follow a scrolling box instead of the page.

Installation

npx shadcn@latest add https://purrfectui.com/r/scroll-reveal.json

How to use

import { ScrollReveal } from "@/components/ui/scroll-reveal";

<ScrollReveal text="Scroll and the words fill in, one after another." />

Source code

Loading…

Credits

Ported from armour.vaibhavtomar.com.

License

MIT. Copy it into your project and change it as you like.

0