Roll Reveal

Text that rolls up into place a word at a time, each word rising through an invisible line as it scrolls into view.

Each word rolls up into place, one after another.

Props
By
Roll35
Stagger0.05
Duration0.80

Installation

pnpm dlx shadcn@latest add @breeze/roll-reveal

Usage

import { RollReveal } from "@/components/breeze/roll-reveal"

It renders a <p> by default and takes your own classes, so style it like any other text.

<RollReveal
  text="Each word rolls up into place, one after another."
  className="text-3xl font-medium tracking-tight"
/>

Use as for a heading, and \n for a new line:

<RollReveal as="h1" text={"Built to move.\nMade to last."} className="text-5xl font-semibold" />

Props

PropTypeDefaultDescription
textstring—The text to reveal. \n starts a new line
as"p" | "h1" | "h2" | "h3" | "h4" | "span" | "div""p"The element to render
by"word" | "letter""word"Roll in a word at a time, or a letter at a time
rollnumber35How far each piece tips back as it rolls in, in degrees. 0 slides straight up
staggernumber0.05Seconds between one piece and the next
durationnumber0.8Seconds each piece takes to roll in
delaynumber0Seconds before the first piece starts
trigger"view" | "mount""view"Play when it scrolls into view, or as soon as it mounts
oncebooleantrueOnly play the first time it comes into view

Each word waits just below an invisible line and rises through it, tipping forward as if it's rolling over a drum. With by="letter", words still never break across lines mid-word. Screen readers get the whole text at once, and with reduced motion the text simply shows, with no animation.

Examples

Letter by letter

Roll call.