1.1.0 • Published 4 years ago

react-pure-carousel v1.1.0

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

react-pure-carousel

Simple React Carousel Library

NPM JavaScript Style Guide downloads MIT License

Example React Pure Carousel

Install

npm install --save react-pure-carousel
yarn add react-pure-carousel

Usage

import React, { Component } from 'react';

import { Carousel } from 'react-pure-carousel';

class Example extends Component {
  render () {
    return (
      <Carousel>
        <Carousel.Background />
        <Carousel.Item>
          <p>Text 1</p>
          <h5>Title 1</h5>
        </Carousel.Item>
        <Carousel.Item>
          <p>Text 2</p>
          <h5>Title 2</h5>
        </Carousel.Item>
        <Carousel.Item>
          <p>Text 3</p>
          <h5>Title 3</h5>
        </Carousel.Item>
      </Carousel>
    );
  }
}

Props

Carousel

Main Carousel component

NameTypeDefaultDescription
themestring'light'Theme for carousel. Can get the following values: dark, light
durationnumber1Transition duration for slides. 1 means 1 second
intervalnumbernullSets the interval between automatic slides scrolling. If value is 1000 it indicates 1 second. If value is null then auto scrolling disabled
loopedbooltrueWhether slides looped inside carousel or not. Available options: true, false
prevArrowstring || HTML elementnullCustom arrow element that leading to the previous slide
nextArrowstring || HTML elementnullCustom arrow element that leading to the next slide
hidePaginationboolfalseWhether show or hide pagination at the bottom
afterSlidefuncHook to be called after a slide is changed
beforeSlidefuncHook to be called before a slide is changed
verticalboolfalseVertical mode for Carousel
alignPaginationOppositeboolfalseWhether display pagination on the opposite side of Carousel or not
enableKeyboardControlsbooltrueWhen set to true will enable keyboard controls when the carousel has focus. If the carousel does not have focus, keyboard controls will be ignored

Carousel.Background

Layer for carousel static background

NameTypeDefaultDescription
srcstringImage path for using as background image
colorstringtransparentBackground color for carousel

Carousel.Item

Carousel Slide

NameTypeDefaultDescription
backgroundColorstringBackground color for certain carousel item
backgroundImagestringBackground image for certain carousel item
alignItemsstring'center'Alignment of the items inside Item. Can get the following values: center, top, bottom

Keyboard controls

KeyAction
Right/Up Arrow or D/W keyNext slide
Left/Down Arrow or A/S keyPrevious slide

License

MIT © Blaine93

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago