Back to all components

Text Reveal

Reveal text with different effects

Hello,world!
Hello,world!Thisisatextrevealeffect.
Hello,world!Thisisatextrevealeffect.

Text Reveal

A text reveal component that reveals text with different effects.

Installation

npm install motion/react

Basic Usage

<TextReveal text="Hello, world!" variant="blur" />

Advanced Usage

<TextReveal
text="Hello, world!"
variant="blur"
className="text-2xl font-bold"
delayPerWord={0.1}
duration={1}
/>

Variants

  • Blur: Blur the text
  • Chat: Chat-like effect
  • Pop: Pop-like effect

Variants - Props

// Blur
<TextReveal text="Hello, world!" variant="blur" className="text-2xl font-bold" delayPerWord={0.1} duration={1} />
// Chat
<TextReveal text="Hello, world!" variant="chat" className="text-2xl font-bold" delayPerWord={0.1} duration={1} />
// Pop
<TextReveal text="Hello, world!" variant="pop" className="text-2xl font-bold" delayPerWord={0.1} duration={1} />

Props

PropTypeDefaultDescription
textstring-The text to reveal
variantstring-The variant of the text reveal
classNamestring-The class name of the text reveal
delayPerWordnumber-The delay per word
durationnumber-The duration of the text reveal

Best Practices

  1. Clear Labels: Use descriptive and concise text reveal labels
  2. Consistent Icons: Use consistent icon styles throughout
  3. Logical Grouping: Group related text reveal items together
  4. Keyboard Navigation: Ensure all items are accessible via keyboard
  5. Loading States: Show loading indicators for dynamic content