Socket
Socket
Sign inDemoInstall

@ryo_suga/react-isomorphic-carousel

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ryo_suga/react-isomorphic-carousel

Isomorphic React Carousel Component.


Version published
Weekly downloads
209
increased by7.18%
Maintainers
1
Install size
322 kB
Created
Weekly downloads
 

Readme

Source

Isomorphic React Carousel Component.

  • Isomorphic
  • Responsive
  • Touch and Swipe (is not draggable yet)

WIP: It is still under development.

Install

npm i @ryo_suga/react-isomorphic-carousel

Usage

import * as React from 'react';
import * as Carouse from '@ryo_suga/react-isomorphic-carousel';

React.render(
  <Carousel>
    <img src="//placehold.it/320x160?text=a" />
    <img src="//placehold.it/320x160?text=b" />
    <img src="//placehold.it/320x160?text=c" />
  </Carousel>,
  document.getElementById('app')
);
Props
nametypedescription
useDotsbooleanuse dots or not. (default false)
dotStyleReact.CSSPropertiescustom css properties for dot button. (default {})
activeDotStyleReact.CSSPropertiescustom css properties for the active dot button. (default {})
durationnumbermiliseconds for animation speed. (default 500)
autoSlideIntervalnumbermiliseconds for auto slide. if 0 or less than 0, auto slide disabled. (default 0)
Next/Prev Button

if you want to call next or prev to move slide position from script, use ref to get Carousel instance.

class App extends React.Component {
  carousel: Carousel
  render() {
    <div>
      <Carousel
        ref={(instance) => { this.carousel = instance; }}
      >
        {/* some element */}
      </Carousel>
      <button
        onClick={() => {
          // call prev
          this.carousel && this.carousel.prev();
        }}
      >
        prev
      </button>
      <button
        onClick={() => {
          // call next
          this.carousel && this.carousel.next();
        }}
      >
        next
      </button>
    </div>
  }
}

Develop

npm start

Test

npm test

Keywords

FAQs

Last updated on 06 Mar 2019

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