Introducing Motion-Primitives Pro - Advanced components and templates to help you build a website that stands out.

Text Effect

Easily animate text content with various effects. You can apply animations per character or per word, and customize the animation effects using custom variants or preset animations.

Examples

Text Effect per character

Animate your ideas with motion-primitives

Text Effect per word

Animate your ideas with motion-primitives

Text Effect with preset

Animate your ideas with motion-primitives

Text Effect with custom variants

Animate your ideas with motion-primitives

Text Effect with custom delay

Animate your ideas

with motion-primitives

(and delay!)

Text Effect per line

now live on motion-primitives!now live on motion-primitives!now live on motion-primitives!

Text Effect with exit animation

Animate your ideas with motion-primitives

Text Effect with speed

You can control the speed of the animation by using the speedReveal and speedSegment props.

Animate your ideas with motion-primitives.

Installation

npx shadcn add "https://motion-primitives.com/c/text-effect.json"

Component API

TextEffect

PropTypeDefaultDescription
childrenstringThe text content to be animated.
per'word' | 'char' | 'line''word'Defines whether animation applies per word, character, or line.
askeyof JSX.IntrinsicElements'p'The HTML tag to render, defaults to paragraph.
variants{ container?: Variants; item?: Variants; }undefinedCustom variants for container and item animations.
classNamestringundefinedOptional CSS class for styling the component.
preset'blur' | 'fade-in-blur' | 'scale' | 'fade' | 'slide''fade'Preset animations to apply to the text.
delaynumber0Delay before the animation starts.
triggerbooleantrueControls whether the animation should be triggered.
onAnimationComplete() => voidundefinedCallback function when the animation completes.
onAnimationStart() => voidundefinedCallback function when the animation starts.
segmentWrapperClassNamestringundefinedOptional CSS class for styling segment wrappers.
styleCSSPropertiesundefinedOptional inline styles for the component.
containerTransitionTransitionundefinedOptional transition for the container.
segmentTransitionTransitionundefinedOptional transition for the segments.
speedRevealnumber1Controls the speed of the reveal animation.
speedSegmentnumber1Controls the speed of the animation.