🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-stacker

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-stacker

3d stacked content swiper/carousel component for React.js

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

react-stacker

Carousel / slider component built with React.js. It’s flexible, fast and touch-friendly.

Imgur

Examples

  • To check out live examples visit https://dmitrymorozoff.github.io/react-stacker/

Getting started

Install react-stacker using npm.

npm install --save react-stacker

or if you prefer yarn

yarn add react-stacker

Usage

import React from "react";
import ReactDOM from "react-dom";
import { StackerSlide, StackerSlider } from "react-stacker";

export class App extends React.Component {
    onChangeHandler = value => {
        console.log("On change slide");
    };

    onPrevChangeHandler = event => {
        console.log("On prev change slide");
    };

    onNextChangeHandler = event => {
        console.log("On next change slide");
    };

    render() {
        const { value } = this.state;
        return (
            <StackerSlider
               dots={true}
                infiniteLoop={true}
                onChange={this.onChangeHandler}
                onPrevChange={this.onPrevChangeHandler}
                onNextChange={this.onNextChangeHandler}
            >
                <StackerSlide>
                    Slide 6/6
                </StackerSlide>
                <StackerSlide>
                    Slide 5/6
                </StackerSlide>
                <StackerSlide>
                    Slide 4/6
                </StackerSlide>
                <StackerSlide>
                    Slide 3/6
                </StackerSlide>
                <StackerSlide>
                    Slide 2/6
                </StackerSlide>
                <StackerSlide>
                    Slide 1/6
                </StackerSlide>
            </StackerSlider>
        );
    }
}

ReactDOM.render(<App />, document.getElementById("root"));

Props

PropsTypeDefaultDescription
classNamestring--
zDistancenumber50Distance between slides by z axis
yDistancenumber30Distance between slides by y axis
transitionDurationnumber0.8Slide transition speed. Number of milliseconds accepted.
infiniteLoopbooleantrueFlag to make the carousel loop around when it reaches the end.
dotsbooleanfalseFlag to render pagination component.
dotsColorstring#0000007dThe fill color of pagination dots. Any valid CSS color is accepted
dotsActiveColorstring#ff0000The fill color of the active pagination dot. Any valid CSS color is accepted.
dotsSizestring8pxThe size of each pagination dot. Pixel values are accepted.
dotsPaddingstring6pxThe padding inside each pagination dot. Pixel values are accepted.
slideWidthstring-Weight of the slides.
slideHeightstring-Height of the slides.

Events

EventTypeEmitter
onChangefunctioncarousel
onPrevChangefunctioncarousel
onNextChangefunctioncarousel

Contributing

  • For bugs and feature requests, please create an issue
  • Lint and test your code
  • Pull requests and ⭐ stars are always welcome

Raising issues

When raising an issue, please add as much details as possible. Screenshots, video recordings, or anything else that can make it easier to reproduce the bug you are reporting.

License

This project is licensed under the MIT License

Keywords

react

FAQs

Package last updated on 21 Dec 2018

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