Skip to content

Text Roll

Letters roll into a second colour on hover or focus.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import TextRoll from "./TextRoll";
export default function Example() {
return (
<TextRoll
text={"MAKE IT MOVE"}
stagger={30}
duration={550}
direction={"up"}
color={"#eee5f2"}
hoverColor={"#d1b0e8"}
style={{
"fontSize": 44,
"fontWeight": 550,
"letterSpacing": "-.05em"
}}
/>
);
}

Using Text Roll

Use a short label with enough line height for the rolling transition. color and hoverColor define the two appearances.

Use active to coordinate the roll with another interaction. stagger controls the spacing between letter starts and direction chooses the movement direction.

Props

NameTypeRequiredDefaultDescription
textstringNo""Text to animate. Spaces and Unicode characters are preserved.
activebooleanNoundefinedOptional controlled animation state; otherwise hover and keyboard focus trigger the effect.
staggernumberNo25Delay between letters in milliseconds.
durationnumberNo500Each letter transition duration in milliseconds.
directionstringNo"up""up" or "down".
colorstringNo"inherit"Initial text colour.
hoverColorstringNo"#cfbae8"Revealed text colour.
classNamestringNo""Additional CSS classes, merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for caller-defined sizing and visual overrides.

Related components

Reflection Text

Text Effects

Crisp typography meets a soft, fading reflection beneath the baseline.

Morphing Words

Text Effects

Words dissolve through a soft blur while the headline keeps its width.

Dot Matrix Text

Text Effects

Amber pinpoints form a crisp matrix display with a soft travelling pulse.

Scan Text

Text Effects

A warm scanning light brings a dim headline into focus.