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

carousel-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carousel-react

carousel with imgs

1.2.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

preview

install

npm install --save-dev carousel-react style-loader css-loader

webpack.config.js

// add loader
{
    test: /\.css$/,
    loader: "style-loader!css-loader"
}

import

import Carousel from 'carousel-react'

use

<Carousel
    previous='./p_l.png'
    next='./p_r.png'
    countDown={1}
    bannerClick={item => console.log(item)}
    setCarouselRestart={handle => this.carouselRestart = handle}
    banners={['3.jpg',
    '1.jpg',
    '2.jpg',
    '3.jpg',
    '1.jpg']}/>
or
<Carousel
    previous='./p_l.png'
    next='./p_r.png'
    countDown={1}
    imgKey='imgUrl'
    bannerClick={item => console.log(item)}
    setCarouselRestart={handle => this.carouselRestart = handle}
    banners={[{
        imgUrl: '3.jpg'
        },
    {
        imgUrl: '1.jpg'
        },
    {
        imgUrl: '2.jpg'
        },
    {
        imgUrl: '3.jpg'
        },
    {
        imgUrl: '1.jpg'
        }]}/>

previous: previous img

next: next img

countDown: countDown time for auto carousel, optional

imgKey: how to get img from banners, optional

banners: array for show, support array with string or object, if object ,must set imgKey

you must put the origin first item on the last, and put the origin last on the first

bannerClick: callback, param is banners's absolute item, optional

carouselRestart: component's restart func, optional, if you get data later, it will be required

Keywords

carousel

FAQs

Package last updated on 05 Sep 2017

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