Text & Numbers

Text Animate

Animate text in word by word, character by character or line by line.

Text Animate splits a string into segments and staggers a preset animation across them. Words, characters and lines are all supported, and the split keeps its whitespace intact so the line never reflows mid-animation.

The animation starts when the text scrolls into view, and is skipped entirely for visitors who have asked for reduced motion.

Usage

Interfaces that move with intent.

<template>
  <div class="flex h-40 w-full items-center justify-center rounded-xl border border-default bg-default px-6">
    <MTextAnimate
      as="h2"
      text="Interfaces that move with intent."
      by="words"
      preset="blurInUp"
      class="max-w-md text-center text-2xl font-semibold text-highlighted"
    />
  </div>
</template>

Examples

Customize

Interfaces that move with intent.

Customize

Asp
Bywords
Delay0.1
Duration0.3
Once
PresetfadeIn
Segment Class
Start On View
TextInterfaces that move with intent.

Props

Prop Type Default Description
textstring''Text to animate. The default slot wins if both are given.
by'words' | 'characters' | 'lines''words'Split the text by words, characters or lines.
presetTextAnimatePreset'fadeIn'Animation to play: fadeIn, blurIn, blurInUp, blurInDown, slideUp, slideDown, slideLeft, slideRight, scaleUp, scaleDown or spinIn.
delaynumber0.1Seconds between one segment starting and the next.
durationnumber0.3Seconds each segment takes to settle.
startOnViewbooleantrueHold the animation until the text scrolls into view.
oncebooleanfalseOnly play once when startOnView is on. With false the text replays every time it re-enters the viewport.
asstring'p'Element to render the text as.
segmentClassstring''CSS classes to apply to each animated segment.
classstring''CSS classes to apply to the root element.

UI

This component's theme exposes the slots below. Override any of them per instance with the ui prop, or app-wide under ui.textAnimate in app.config.ts.

Prop Type Default Description
uiobject-Per-slot classes merged over the theme defaults.
Slot Props Description
root-inline-block
segment-inline-block whitespace-pre
space-whitespace-pre
Copyright © 2026