Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
react-fast-marquee
Advanced tools
A lightweight React component that utilizes the power of CSS animations to create silky smooth marquees.
react-fast-marquee is a React component that allows you to create scrolling text or images, also known as a marquee. It is designed to be highly customizable and performant, making it easy to add scrolling content to your React applications.
Basic Marquee
This feature allows you to create a basic scrolling text marquee. The text will scroll from right to left by default.
<Marquee>Some scrolling text</Marquee>
Custom Speed
You can customize the speed of the scrolling text by setting the 'speed' prop. The higher the number, the faster the text will scroll.
<Marquee speed={50}>Faster scrolling text</Marquee>
Direction Control
This feature allows you to change the direction of the scrolling text. By setting the 'direction' prop to 'right', the text will scroll from left to right.
<Marquee direction='right'>Scrolling text to the right</Marquee>
Pause on Hover
You can make the marquee pause when the user hovers over it by setting the 'pauseOnHover' prop to true.
<Marquee pauseOnHover={true}>Hover to pause scrolling</Marquee>
Gradient Effect
This feature adds a gradient effect to the edges of the marquee, giving it a more polished look. You can enable this by setting the 'gradient' prop to true.
<Marquee gradient={true}>Scrolling text with gradient</Marquee>
react-marquee-line is another React component for creating scrolling text. It offers similar functionality but is less customizable compared to react-fast-marquee. It is simpler to use but lacks some advanced features like gradient effects.
react-ticker is a React component for creating news ticker-like scrolling text. It is highly customizable and offers features like pausing on hover and custom speeds. However, it is more focused on ticker-style scrolling rather than a full marquee.
react-scroll-text is a React component that allows you to create scrolling text with various customization options. It is similar to react-fast-marquee but offers additional features like vertical scrolling and more control over the appearance of the text.
React Fast Marquee is a lightweight React component that utilizes the power of CSS animations to create silky smooth marquees.
Check out the demo here and play around with some sample marquees.
If you're using npm
, in the command prompt run:
npm install react-fast-marquee --save
If you're using yarn
, run:
yarn add react-fast-marquee
To use the component, first import Marquee
into your file:
import Marquee from "react-fast-marquee";
Then wrap the <Marquee>
tags around any component or text you'd like to slide.
<Marquee>
I can be a React component, multiple React components, or just some text.
</Marquee>
A sample file might look like this:
import React from "react";
import MyComponent from "../components/MyComponent";
import Marquee from "react-fast-marquee";
const App = () => (
<Marquee>
<MyComponent />
<MyComponent />
<MyComponent />
</Marquee>
);
export default App;
Property | Type | Default | Description |
---|---|---|---|
style | object | {} | Inline style for the container div |
className | string | "" | Name of the css class to style the container div |
play | boolean | true | Whether to play or pause the marquee |
pauseOnHover | boolean | false | Whether to pause the marquee when hovered |
pauseOnClick | boolean | false | Whether to pause the marquee when clicked |
direction | "left" or "right" | "left" | The direction the marquee is sliding |
speed | number | 20 | Speed calculated as pixels/second |
delay | number | 0 | Duration to delay the animation after render, in seconds |
gradient | boolean | true | Whether to show the gradient or not |
gradientColor | Array<number> of length 3 | [255, 255, 255] | The rgb color of the gradient as an array of length 3 |
gradientWidth | number or string | 200 | The width of the gradient on either side |
children | ReactNode | null | The children rendered inside the marquee |
FAQs
A lightweight React component that utilizes the power of CSS animations to create silky smooth marquees.
The npm package react-fast-marquee receives a total of 120,555 weekly downloads. As such, react-fast-marquee popularity was classified as popular.
We found that react-fast-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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.