1.1.2 • Published 3 years ago

react-jedlislider v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-jedlislider

npm.ioNPM

What is jedliSlider?

jedliSlider is interactive, continuous carousel with multiple options to use in your React app.

react-jedlislider is react version of jedliSlider with only continuous mode (because this mode is the one fully finished, and used the most)

DEMO page

DEMO

Compatibility

Slider is built on css flexbox. So will be compatible with every browser that supports flexbox.

Why jedliSlider?

Because it’s easy to use, modern and will have all options that you want. Some popular carousels still use floats and a lot of unnecessary scripts/styles. My intention was to create one slider, that will contain all things i missed in other carousels. With as low code and css as possible. So you don't need to override some default styles.

What's new?

v. 1.1.2

  • Added resizeHandler so slider will recalculate if should rotate when width of slide change (usefull when width of slide is based on lazy loading image)

Previous update:

  • React version of jedliSlider

Install

npm install --save react-jedlislider

Basic Usage

import React,  { Component }  from  'react'

  

import JedliSlider,  { JedliSlide }  from  'react-jedlislider'

import  'react-jedlislider/dist/index.css'

  

class  Example  extends  Component  {

  render()  {

    return  (

    <JedliSlider>

      <JedliSlide>Your slide 1</JedliSlide>

      <JedliSlide>Your slide 2</JedliSlide>

      <JedliSlide>Your slide 3</JedliSlide>

    </JedliSlider>

    )

  }
}

Usage with custom settings

import React,  { Component }  from  'react'

  

import JedliSlider,  { JedliSlide }  from  'react-jedlislider'

import  'react-jedlislider/dist/index.css'

  

class  Example  extends  Component  {

  render()  {

    return  (

    <JedliSlider speed={125} slidesWidth='auto'>

      <JedliSlide>Your slide 1</JedliSlide>

      <JedliSlide>Your slide 2</JedliSlide>

      <JedliSlide>Your slide 3</JedliSlide>

    </JedliSlider>

    )

  }
}

List of options

More info on DEMO page

Option:Default:Available options:Description:
tagstring: 'div'string: all HTML tagsHtml tag for slider wrapper
slidesWidthstring: 'equal'string: 'equal'/'auto'determinate if all slides should be same size, specified by slider; or width of every slides can be different, specifed from css/content
speedint: 100int > 0Transition duration of one single change. Speed is calculated: given speed width of all slides 1000
visibleSlidesint: 1int > 0This option works when "slidesWidth" is set to "equal". Determinate how many slides will be visible. Width of every slide will be calculated to match given value. * For example if visibleSlides is set to 2, every slide's width gonna be 50%
overflowstring: 'hidden'string: 'hidden'/'visible'Define if slider should have overflow hidden or not
pauseOnHoverbool: falsebool: false/trueDeterminate if carousel should stop animation on hover, or for accessibility reasons - on focus on any element inside slider
directionstring: 'ltr'string: 'ltr'/'rtl'Determinate if carousel should rotate from left to right, or right to left

License

MIT © jedlikk

1.1.2

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago