Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
react-text-loop
Advanced tools
An animated loop of text nodes for your headings. Uses react-motion for the transition so it handles super fast animations and spring params.
npm install react-text-loop
|| yarn add react-text-loop
import TextLoop from 'react-text-loop';
class App extends Component {
render() {
return (
<h2>
<TextLoop>
<span>First item</span>
<Link to="/">Second item</Link>
<BodyText>Third item</BodyText>
</TextLoop> and something else.
</h2>
);
};
}
Prop | Type | Default | Definition |
---|---|---|---|
speed | number | 3000 | The speed that the words change (in ms). Set to 0 to stop animation. |
adjustingSpeed | number | 150 | The speed that the container around each word adjusts to the next one (in ms) |
fade | boolean | true | Enable or disable the fade animation on enter and leave |
mask | boolean | false | Mask the animation around the bounding box of the animated content |
springConfig | object | { stiffness: 340, damping: 30 } | Configuration for react-motion spring |
style | object or array | Any additional styles you might want to send to the wrapper. Uses glamor to process it so you can send either objects or arrays. | |
children | node | The words you want to loop (required) |
Because <TextLoop>
loops through its children nodes, only root-level nodes will be considered so doing something like:
<TextLoop>
<div>
<span>First item</span>
<span>Second item</span>
</div>
<div>Third item</div>
</TextLoop>
will make first and second item to be treated as one and animate together.
You can also just send a normal array as children prop if you don't need any individual styling for each node.
<TextLoop
children={[
"Trade faster",
"Increase sales",
"Stock winners",
"Price perfectly"
]}
/>
<TextLoop speed={100}>
...
</TextLoop>
<TextLoop springConfig={{ stiffness: 180, damping: 8 }}>
...
</TextLoop>
Please follow our contributing guidelines.
FAQs
Create an animated loop of a list of text for your headings
The npm package react-text-loop receives a total of 921 weekly downloads. As such, react-text-loop popularity was classified as not popular.
We found that react-text-loop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.