Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-marquee-text
Advanced tools
MarqueeText is a React component that takes it back to the internet of days gone by. Paying homage to the vintage (and beloved) Marquee element, MarqueeText inserts areas of continuous scrolling text, empowering your retro or brutalist-inspired designs.
npm i react-marquee-text
import MarqueeText from "react-marquee-text"
import "MarqueeText/styles.css"
function SomeComponent() {
return (
<MarqueeText>
Let's bring it on back to days of yore
</MarqueeText>
)
}
Depending on your CSS bundling configuration, you may have to also import MarqueeText's CSS file (which houses the simple @keyframe aniamtion)
Install npm i react-marquee-text
Build: npm run build
Dev: npm run dev
Demo Run: npm run demo:start
Demo Build: npm run demo:build
Demo Clean: npm run demo:clean
Runing dev
fires up the docs/demo and begins watching src
.
The docs/demo app is bundled with Parcel.js
and served at http://localhost:1234/.
On build, src
populates dist
with commonjs, es, umd versions of the component.
Option | Type | Description | Default |
---|---|---|---|
children | sring | React children for providing text as string | null |
className | string | Defines a parent class name | null |
direction | 'left' | 'right' | Direction of scroll animation | left |
duration | number | Amount of time it takes for original text to complete animation | 50 |
textSpacing | string | Spacing between cloned text items | 0.15em |
pauseOnHover | boolean | Pauses scroll animation on hover | false |
playOnlyInView | string | Only run play animation when component is visible in viewport | true |
treshold | number | Intersection Observer value between 0 and 1 representing the percentage component must be visible before stagger animation starts. | 0.1 |
willChange | boolean | Adds will-change to animation to potential enhance animation performance | false |
<MarqueeText
duration={30}
pauseOnHover={true}
direction="right"
>
This be some right scroll text
</MarqueeText>
The package largely uses inlined CSS. Currently, the @keyframes
animation is the only declaration housed in an external CSS file. styles.css
is imported into the tsx
file, but given your bundle setup, you may, or may not, have to handle that import. If the animation doesn't run immediately, try importing react-marquee-text/styles.css
directly in your project.
MarqueeText supports HTML elements, so you can wrap your text in spans or divs to style specific words.
Have fun ya'll.
FAQs
A React TS component that creates continous scrolling text.
The npm package react-marquee-text receives a total of 0 weekly downloads. As such, react-marquee-text popularity was classified as not popular.
We found that react-marquee-text demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.