sancarousel v1.3.1
SanCarousel
A simple Carousel easy to use and very customizable.
Overview
SanCarousel is a performance focused library that helps you create a slide easily and very customizable in just a few steps.
Getting started
npm
npm install sancarousel --save
yarn
yarn add sancarousel
Usage
Example 1
import React from 'react';
import SanCarousel from 'sancarousel';
import slide1 from '../assets/slide_1.png'
import slide2 from '../assets/slide_1.png'
const slides = [
{
img: slide1,
url: '/link-1'
},
{
img: slide2,
url: '/link-2'
}
];
const App = () => {
<SanCarousel slides={slides} />
}
You can pass several properties to SanCarousel and customize it the way you prefer
Example 2
import React from 'react';
import SanCarousel from 'sancarousel';
import slide1 from '../assets/slide_1.png'
import slide2 from '../assets/slide_1.png'
const slides = [
{
img: slide1,
url: '/link-1'
},
{
img: slide2,
url: '/link-2'
}
];
const App = () => {
<SanCarousel
slides={slides}
height="350px"
slideSize="90%"
autoPlay={2000}
focusSlide
spaceBetweenSlides="10px"
/>
}
Properties available
slides
: Array with images and urls (optional) to be displayedtransitionTime
: Transition time from one slide to anotherautoPlay
: Autoplay Speed in millisecondswidth
: Main container widthheight
: Main container heightslideSize
: Slide size to be showndots
: Show dot indicatorsdotsDiameter
: Diameter of dot indicatormarginRightDots
: right margin of dots containermarginBottomDots
: bottom margin of dots containerarrows
: Prev/Next ArrowsspaceBetweenSlides
: Space between slidesfocusSlide
: Enable focus on selected element (hover)slideFocusColor
: Focus color on the selected elementfocusSlideThickness
: Focus thickness on the selected slidecontainerBorderRadius
: Main container radius sizeslideBorderRadius
: Slide size radius