1.1.4 • Published 7 years ago

@chuck-durst/react-carousel v1.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

react-carousel (1.1.4)

A simple and powerful carousel for React.

Installation

yarn add @chuck-durst/react-carousel or npm i -s @chuck-durst/react-carousel

Introduction

react-carousel has been designed to work on both mobile and desktop. It comes with a lot of configurations to make it feet to any type of design.

react-carousel works with the background-image property which makes it fully responsive!

Usage

All you have to do is importing the component to your project and specifying your slides!.

import React from 'react'

import ReactCarousel from '@chuck-durst/react-carousel'

const App = (props) => {
	return (
		<ReactCarousel slides={ props.slides } />
	)
};

###checkout the demo for a better example of how to use it!

Props

PropertyTypeDescriptionDefault value
slidesarrayContains yours slides urls. (required)-
classNameStringThe class name of the main componentce-carousel
showArrowsboolDefines if the navigation arrows must be showedtrue
showDotsboolDefines if the pagination dots must be showedtrue
autoPlayboolEnables the automatic playfalse
autoPlayDelayintThe delay between each slide in autoPlay in ms5000
slidesSpeedintThe slides movement speed in ms150 
isInfiniteboolDefines if the slider is infinitetrue
isAnimatedboolDefines if the slides should be animatedtrue
stopOnHoverboolAllows you to stop the autoPlay when the component is hoveredfalse
slideNavigationboolAllows sliding on mobile and desktoptrue
allowKeyboardboolAllows you to navigate using your keyboard arrowstrue
customNextArrowReact ElementA custom arrow element (if you need inspiration you can take a look at the original element: src/NextArrow)-
customPrevArrowReact ElementA custom arrow element (if you need inspiration you can take a look at the original element: src/PrevArrow)-
customDotsfunctionA function used to map the pagination dots which takes two parameters (index, isActive) to let you fully customize the pagination (take a look at the original element: src/Dot)-
beforeChangefunctionA callback called before each slides changes (the first parameter corresponds to the index of the current active slide)-
afterChangefunctionA callback called after each slides changes (the first parameter corresponds to the index of the new active slide. The second parameter contains the slide direction)-
goToSlideintAllows you to go to a defined slidenull
backdropColorstringThe component background-color. Can be any css color propertynull
sliderClassNamestringThe className of the slider elementce-carousel__slider
slidesClassNamestringThe className of the slides elementce-carousel__slide

Take a look at the demo folder if you are stuck! :)

License

react-carousel is released under the MIT license.

Contribute

Feel free to contribute to this project if you know how to make it be better.

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago