Text reveal
Fade a sentence in word by word. Static for reduced motion.
SourceStyles source@monoline/react 0.4.0Markdown for AI toolsstable
- Built on native elements
- The text stays real text in reading order; nothing is hidden from assistive tech.
- With prefers-reduced-motion every word is visible at once.
- Styles in one file:
text-reveal.css
Import
import '@monoline/css';
import {TextReveal} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add text-reveal
Usage
import {TextReveal} from '@monoline/react';
<TextReveal
text="Every word arrives in turn, so the eye can follow the sentence."
style={{fontFamily: 'var(--font-display)', fontSize: 'var(--display-sm)'}}
/>
Examples
Default
Slower
Props
TextRevealProps
| Prop | Type | Default | Description |
|---|---|---|---|
text required | string | – | The sentence to reveal, word by word. |
stagger | number | 80 | Milliseconds between words. Default 80. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.text-reveal-word | text-reveal.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.text-reveal-word {
border-color: var(--accent);
}
Accessibility
- The text stays real text in reading order; nothing is hidden from assistive tech.
- With prefers-reduced-motion every word is visible at once.