Socket
Socket
Sign inDemoInstall

react-smooth-marquee

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-smooth-marquee

Another implementation of a marquee tag in React, designed to avoid stuttering issues


Version published
Weekly downloads
604
increased by54.87%
Maintainers
1
Install size
9.17 kB
Created
Weekly downloads
 

Readme

Source

react-smooth-marquee

A simple marquee component for ReactJS using requestAnimationFrame

See a demonstration here (source is in demo.html).

Installation

npm install react-smooth-marquee --save

Importing

ES6:

import Marquee from "react-smooth-marquee"

ES5 with require (e.g. using webpack):

var Marquee = require("react-smooth-marquee")

Usage

The component is pretty simple at present (although I expect it will accumulate additional properties in later versions...):

<Marquee>Content goes here </Marquee>

There is one optional property, velocity, which sets the movement velocity (in CSS pixels per millisecond). It defaults to 0.12, which seems a reasonably sensible value for most applications.

The component expects two CSS classes to be defined, but does not include any definitions itself (in order to allow for highest flexibility). These are:

.Marquee

This sets styles on the container, i.e. the outer element whose position remains static. It should usually have display: block (although as a <div> element is used this is the default) and for correct function must have overflow-x: hidden.

.MarqueeContent

This sets styles on the child that is moved within the container. In order to allow correct calculation of when the element is moved from the left hand edge of the display back to the right, it should usually be set up either with display: block and an explicit width, or with display: inline-block so that width can be calculated from its contents.

FAQs

Last updated on 12 Oct 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc