TextReveal
Reveals a line of text word by word or character by character.
Animatedimport { TextReveal } from 'umbra-ui/motion'
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children required | string | — | The text to reveal. Must be a plain string so it can be split and still read as one phrase. |
as | ElementType | p | Element to render, e.g. `"h1"`. |
by | "word" | "char" | word | Split unit. |
delay | number | 0 | Seconds to wait before starting. |
reducedMotion | "system" | "always" | "never" | "system" | Reduced-motion override. Under reduced motion the whole text fades in at once, with no movement. |
trigger | "mount" | "inView" | mount | Start on mount, or when scrolled into view. |
Usage notes
Children must be a plain string.
Accessibility
- Assistive tech gets the full sentence once from a visually hidden copy; the animated pieces are
aria-hidden. - Under reduced motion the text fades in as one block.
Import
import { TextReveal } from 'umbra-ui/motion';
import 'umbra-ui/styles.css'; // once, at the root of your app