Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Text Animation

Dia Text Animation

ChromaticTextReveal.vue
Motion that feels natural.

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/chromatic-text-reveal

Import the shared styles once in your application.

TSUsage
import ChromaticTextReveal from '@/components/beui/effects/ChromaticTextReveal.vue'
import '@/components/beui/styles.css'

API Reference

prefix
string

Sentence fragment that remains fixed while the final word changes.

Default—
words
readonly string[]

Words revealed one after another after the fixed prefix.

Default—
colors?
readonly string[]

Colors used along the moving chromatic edge.

Default—
foregroundColor?
string

Final text color after the sweep passes.

Defaultvar(--beui-foreground)
duration?
number

Sweep duration in seconds.

Default1.2
delay?
number

Delay before the first sweep, in seconds.

Default0
pauseDuration?
number

Rest after a word finishes revealing, in seconds.

Default.8
loop?
boolean

Returns to the first word after the final word.

Defaulttrue
startOnView?
boolean

Starts when the text enters the viewport.

Defaulttrue
once?
boolean

Only starts on the first viewport entry.

Defaulttrue
inViewMargin?
string

IntersectionObserver root margin used by the viewport trigger.

Default—
class?
string
Default—
paused?
boolean
Defaultfalse
Also on React Native. Reveals, sweeps, shimmers, cascades and scrambles.(opens in a new tab)

Updated