
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
react-text-transition
Advanced tools

npm install -S react-text-transition
npm run dev
import React from 'react';
import TextTransition, { presets } from 'react-text-transition';
const TEXTS = ['Forest', 'Building', 'Tree', 'Color'];
const App = () => {
const [index, setIndex] = React.useState(0);
React.useEffect(() => {
const intervalId = setInterval(
() => setIndex((index) => index + 1),
3000, // every 3 seconds
);
return () => clearTimeout(intervalId);
}, []);
return (
<h1>
<TextTransition springConfig={presets.wobbly}>{TEXTS[index % TEXTS.length]}</TextTransition>
</h1>
);
};
| Prop | Type | Default | Definition |
|---|---|---|---|
| direction | String (enum) | 0 | Used to determine the direction of the transition "up" or "down" (Must be an all-lowercase string). |
| inline | Boolean | false | Makes the wrapper inline (will auto resize based on contents). |
| delay | Number | 0 | Delay the transition of the text (in milliseconds). |
| springConfig | Object | { mass: 1, tension: 170, friction: 26 } | react-spring's spring configuration. |
| className | String | "" | Any css classes that you might want to send to the wrapper. |
| style | React.CSSProperties | {} | Any styles that you might want to send to the wrapper. |
| children | React.ReactNode | REQUIRED | The react node to be animated |
| translateValue | string | "100%" | Transform value for determine height animation |
BooleanWill simply make the wrapper an inline element and animate its width based on currently showing text, this is useful if you want to show some other static text on the same line.
NumberThe amount of miliseconds to wait before transitioning.
Objectreact-spring's Spring configuration (Refer to the
configs section) react-spring's spring presets are exposed as presets.
import TextTransition, { presets } from 'react-text-transition';
// in your render method
<TextTransition springConfig={presets.wobbly}>{this.state.text}</TextTransition>;
You have the following presets
default The default.gentlewobblystiffslowmolassesStringAny css classes that you might want to provide to the wrapper.
React.CSSPropertiesAny css styles that you might want to provide to the wrapper.
Feel free to ask any questions about using this component. This plugin requires react +16.8
FAQs
A React plugin that animates your text when it changes.
The npm package react-text-transition receives a total of 14,133 weekly downloads. As such, react-text-transition popularity was classified as popular.
We found that react-text-transition demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.