1.1.9 • Published 11 months ago

styled-img-slider v1.1.9

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Styled Image Slider

Styled Image Slider is a simple js/ts react component. Developed with typescript and styled with styled-components.


Parameters

It takes 2 parameters / props:

interface SliderProps {
  images: string[];
  timerOptions?: number;
}

images

An array of string url values that point to each image. In react you normally want to import the images to maintain the relative url after building. Then, just pass them in an array.

timerOptions

The time (in milliseconds) for each interval between slides. It always slides forwards, looping back to the start after it reaches the end.

After user interaction (meaning manually selecting a slide or sliding forwards or backwards), the timer is reset.

If left out, default timer is 6500ms or 6.5 seconds

Placement

The Slider component has to be placed inside a parent component that will give it shape. There is no other way to adjust height or width of the slider.


Usage

import Slider from 'styled-img-slider'
import firstPic from 'url/firstImg.jpg'
import secondPic from 'url/secondImg.jpg'

[...]

<div className='slider-parent' >

  <Slider images={[firstPic, secondPic]} timerOptions={5000} />

</div>

[...]

1.1.9

11 months ago

1.1.6

11 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.4-0

11 months ago

1.0.3-0

11 months ago

1.0.2-0

11 months ago

1.0.1-0

11 months ago

1.0.0

11 months ago

0.1.21-0

11 months ago

0.1.20-0

11 months ago

0.1.19-0

11 months ago

0.1.18-0

11 months ago

0.1.17-0

11 months ago

0.1.16-0

11 months ago

0.1.15-0

11 months ago

0.1.14-0

11 months ago

0.1.12

11 months ago

0.1.12-0

11 months ago

0.1.11-0

11 months ago

0.1.10-0

11 months ago

0.1.9-0

11 months ago

0.1.8-0

11 months ago

0.1.7-0

11 months ago

0.1.6-0

11 months ago

0.1.5-0

11 months ago

0.1.4-0

11 months ago

0.1.3-0

11 months ago

0.1.2-0

11 months ago

0.1.1-0

11 months ago

0.1.0

11 months ago