Skip to content

Text Roll

Free

A link or button label rolls on hover, press, or focus: a copy rolls up from below, letter by letter or as one.

  • React 19
  • Tailwind CSS 4

Added Nov 14, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Put it inside a link or a Button as its label. It rolls when the control is hovered, pressed, or focused.

The sample also uses Button. One command adds them with this item:

site-header.tsx

TextRoll

<span>
PropTypeDefaultDescription
localestring—The BCP 47 locale for the letter and word split (Intl.Segmenter). Default: the DisplayLocaleProvider locale, else "en-US".
childrenRequiredstring—The label. It rolls when the link or button around it is hovered, pressed, or has keyboard focus.
mode"label""letters""letters"letters (default): each letter rolls up, one after another. label: the whole label slides up and out while its copy slides in from below, as one block (a label on two lines too).
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Put it inside a link or a Button: it reads the hover, press, and focus of the nearest one.
  • Use the default letters mode for a short label, and mode="label" for a long label or one that wraps.
  • Set --text-roll-color on the root to give the copy that rolls in another color.
  • For a label that scrambles through random letters, use Text Scramble.
  • For a plain button with no motion on its label, use Button.
TabMoves the focus to the link or button around the label. The label rolls while it has keyboard focus.
Letters
panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) · each letter moves up one line plus a gap while its copy comes up from below, 20ms after the letter before it
Label
panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) · the whole label slides up and out while its copy slides in from below
Roll back
panel · 260ms · ease-panel (0.2, 0.4, 0.2, 1) · when the hover, press, or focus ends, the label rolls back from where it is, with no jump
  1. AddedText Roll.
Open the release