Notorious Preying Mantis
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

react-rotation

1.3.0 • Public • Published

react-rotation Build Status

React rotation component

Supports wheel, keyboard, mouse and touch events

Install

npm install --save react-rotation

Usage

import React from 'react'
import {render} from 'react-dom'
import Rotation from 'react-rotation'
 
render(
  <Rotation>
    <img src='images/00.jpg' />
    <img src='images/01.jpg' />
    <img src='images/02.jpg' />
    <img src='images/03.jpg' />
  </Rotation>,
  document.querySelector('.container')
)

Props

  • className - class name of container, string
  • cycle - cyclic rotation, boolean, default false
  • scroll - rotation by wheel/scroll, boolean, default true
  • vertical - vertical orientation, boolean, default false
  • reverse - reverse rotation, boolean, default false
  • tabIndex - order of focusable element, number|string, default 0
  • autoPlay - start a frame playback with specified speed, boolean|number, default false
  • pauseOnHover - pause a frame playback on mouse hover, boolean, default false
  • onChange - frame change event handler, function

Related

  • circlr — animation rotation via scroll, mouse and touch events

License

MIT

install

npm i react-rotation

Downloadsweekly downloads

1,282

version

1.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability