Full docs with examples: https://pawelgrzybek.com/siema/.
Siema is a lightweight (only 1kb gzipped) carousel plugin with no dependencies and no styling. As Brad Frost once said "do that shit yourself". It is 100% open source and available on Github. It is free to use on personal and commercial projects. Use it with your favourite module bundler or by manually injecting the script into your project.
Setup is trivially easy. A little bit of markup...
<div class="siema">
<div>Hi, I'm slide 1</div>
<div>Hi, I'm slide 2</div>
<div>Hi, I'm slide 3</div>
<div>Hi, I'm slide 4</div>
</div>
If you are using a module bundler like Webpack or Browserify...
npm i -S siema
// or
yarn add siema
import Siema from 'siema';
new Siema();
...or manually inject the minified script into your website.
<script src="siema.min.js"></script>
<script>
new Siema();
</script>
Siema comes with a few (optional) settings that you can change by passing an object as an argument. Default values are presented below.
new Siema({
selector: '.siema',
duration: 200,
easing: 'ease-out',
perPage: 1,
startIndex: 0,
draggable: true,
threshold: 20,
loop: false,
});
selector
- (string or DOM element) specify the selectorduration
- (number) slide transition duration (in ms)easing
- (string) the same as transition-timing-function in CSSperPage
- (number or object) the number of slides to be shownstartIndex
- (number) index of the starting slide (zero-based)draggable
- (boolean) use dragging and touch swipingthreshold
- (number) touch and mouse dragging threshold (in px)loop
- (boolean) loop the slides around
As mentioned above, Siema doesn't come with many options - just a few useful methods. Combine it with some very basic JavaScript and voila!
next()
- go to next slideprev()
- go to previous slidegoTo(index)
- go to a specific slidedestroy()
- remove all active listenerscurrentSlide
- index of the current active slide (read only)
- IE10
- Chrome 12
- Firefox 16
- Opera 15
- Safari 4
- Android Browser 4.0
- iOS Safari 6.0