0.1.3 • Published 2 years ago

@uppercod/keen-slider v0.1.3

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

@uppercod/keen-slider

Working...

It is a wrapper for keen-slider as a webcomponent created with Atomico.

Example

HTML

<keen-slider>
  <div>slide 1</div>
  <div>slide 2</div>
  <div>slide 3</div>
  <div>slide 4</div>
</keen-slider>

React

To use in React you must first install the dependency @atomico/react.

import { Slider } from "@uppercod/keen-slider/components.react";

function App() {
  return (
    <>
      <Slider>
        <div>slide 1</div>
        <div>slide 2</div>
        <div>slide 3</div>
        <div>slide 4</div>
      </Slider>
    </>
  );
}

Api

currently the component reflects the following options from the original api.

Properties

Property / AttributeTypeDescription
loopbooleanInfinite loop of slides
centeredbooleanActive slide will be centered - only makes sense, when slidesPerView is greater than 1
verticalbooleanSet the slider direction to vertical
autoplaybooleandefines if the slide advances automatically
autoplayMs / autoplay-msnumber, default 5000timeout to retrieve autoplay loop
durationnumber, default 500Set the animation duration for the "snap"-mode
slidesPerView / slides-per-viewnumber, default 1Number of slides per view
spacingnumber, default 0Spacing between slides in pixel
modestring, default snapSet the mode of movement of the slider
sliderKeenSliderKeenSlider Last Instance
breakpointsObjectdefines the breakpoints for the instance of KeenSlider, eg '(min-width: 720px) and (max-width: 1000px)': {loop: false}

Events

breakpoints

<keen-slider
  breakpoints='{">=500px": { "loop": false, "duration": 500, "autoplay": false }}'
></keen-slider>
0.1.2

2 years ago

0.1.3

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago