New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-html-rotator2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-html-rotator2

Simple React component for rotating text

latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

React-text-rotator

Travis npm package Coveralls

Simple React component for rotating text.

See the demo.

Getting Start

npm install react-text-rotator --save

Usage

import React from 'react';
import ReactTextRotator from 'react-text-rotator';

const content = [
  {
    text: 'We shall fight on the beaches.',
    className: 'classA',
    animation: 'fade',
  },
  {
    text: 'We shall fight on the landing grounds.',
    className: 'classB',
    animation: 'fade',
  },
  {
    text: 'We shall fight in the fields and in the streets.',
    className: 'classC',
    animation: 'fade',
  },
  {
    text: 'We shall fight in the hills.',
    className: 'classD',
    animation: 'fade',
  },
  {
    text: 'We shall never surrender...',
    className: 'classE',
    animation: 'fade',
  },
];

const MyComponent = () => (
  <div>
    <h1>Churchill Speech</h1>
    <ReactTextRotator
      content={content}
      time={5000}
      startDelay={2000}
    />
  </div>
);

Props

NameTypeRequiredDefaultObs
contentArrayTrueArray of content shape (see bellow)
timeNumberFalse2500Time in milliseconds
startDelayNumberFalse250Wait before the first content (milliseconds)
transitionTimeNumberFalse500Time in milliseconds

Content shape

NameTypeRequiredDefaultObs
textStringTrueText to be shown
classNameStringFalseClass name for each span
animationStringFalse'fade'Pre-defined animation for the content (only fade is available)

Development

Installation

  • Clone git clone https://github.com/claytonmarinho/react-text-rotator.git.

  • Running npm install in the components's root directory will install everything you need for development.

Demo Development Server

  • npm start will run a development server with the component's demo app at http://localhost:3000 with hot module reloading.

Running Tests

  • npm test will run the tests once.

  • npm run test:coverage will run the tests and produce a coverage report in coverage/.

  • npm run test:watch will run the tests on every change.

Building

  • npm run build will build the component for publishing to npm and also bundle the demo app.

  • npm run clean will delete built resources.

Keywords

react

FAQs

Package last updated on 07 Jan 2020

Did you know?

Socket

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