uibrik

Rolling Word

Preview

Customize

Duration0.45s
Exit duration0.35s
Stagger0.030s
Text size48px

Usage

import { RollingWord } from "@/components/uibrik/rolling-word/rolling-word";

<RollingWord play={play} />

Installation

npx shadcn@latest add https://uibrik.com/r/rolling-word.json
Adds the files to components/uibrik/rolling-word and installs motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/rolling-word.

Props

RollingWord
prefix
Type string
"Build something"
Fixed text before the rolling word.
words
Type string[]
["calm","honest","lasting","yours"]
Cycled through, one per play.
duration
Type number
0.45
Time for a letter to roll in.
exitDuration
Type number
0.35
Time for a letter to roll out.
stagger
Type number
0.03
Delay between letters.
playrequired
Type number
–
Each change plays the effect again; 0 shows its resting state.
className
Type string
–
Classes for the line, merged over the defaults.