Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@wethegit/react-marquee
Advanced tools
- [Getting set up](#getting-set-up) - [Install](#install) - [Import the CSS](#import-the-css) - [Usage](#usage) - [Props](#props) - [Styling](#styling) - [Reduced motion](#reduced-motion)
npm install @wethegit/react-marquee
Import this wherever it makes sense to, based on your project structure:
import "@wethegit/react-marquee/style.css"
const YourComponent = () => {
const prefersReducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches
return (
<Marquee
className="marquee--modifier-class"
prefersReducedMotion={prefersReducedMotion}
reducedMotionSpeed={20}
>
{/* Good practice to add size of image to avoid stutter */}
<img src="image-1.png" alt="" width="500" height="500" />
<img src="image-2.png" alt="" width="500" height="500" />
<img src="image-3.png" alt="" width="500" height="500" />
</Marquee>
)
}
Prop | Type | Default value | Description |
---|---|---|---|
speed | Number | 50 | Controls the speed of the marquee animation. If prefersReducedMotion is true, speed defaults to reducedMotionSpeed . |
reducedMotionSpeed | Number | 20 | A customisable value used to set the speed of the component if prefersReducedMotion is true. |
prefersReducedMotion | Boolean | false | Whether the user prefers reduced motion. If true , the component will default to a much slower speed, unless a custom speed is specified using: reducedMotionSpeed . |
playing | Boolean | true | Whether the marquee animation is playing or paused. |
reverse | Boolean | false | Whether the marquee should animate from left to right. |
className | String | Optional class added to the parent element. | |
children | Node | The child elements rendered within the component. In the example above these are images, however they can be any type of element. |
This component uses the BEM methodology for CSS classNames — the block here being .marquee
.
Use the prefersReducedMotion
prop to serve up a reduced motion experience for your users who have that option enabled on their systems. The boolean prefersReducedMotion
prop can be derived via the browser's matchMedia API
, if true the marquee defaults to a much slower speed, unless reducedMotionSpeed
is passed. This workflow is demonstrated in the Usage section above.
FAQs
- [Getting set up](#getting-set-up) - [Install](#install) - [Import the CSS](#import-the-css) - [Usage](#usage) - [Props](#props) - [Styling](#styling) - [Reduced motion](#reduced-motion)
The npm package @wethegit/react-marquee receives a total of 0 weekly downloads. As such, @wethegit/react-marquee popularity was classified as not popular.
We found that @wethegit/react-marquee demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
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.