Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

siema

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

siema

Lightweight and simple carousel with no dependencies

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
increased by10.37%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Installation

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...

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>

Options

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 selector
  • duration - (number) slide transition duration (in ms)
  • easing - (string) the same as transition-timing-function in CSS
  • perPage - (number or object) the number of slides to be shown
  • startIndex - (number) index of the starting slide (zero-based)
  • draggable - (boolean) use dragging and touch swiping
  • threshold - (number) touch and mouse dragging threshold (in px)
  • loop - (boolean) loop the slides around

API

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(howManySlides = 1) - go to next slide (optionally few items)
  • prev(howManySlides = 1) - go to previous slide (optionally few items)
  • goTo(index) - go to a specific slide
  • destroy() - remove all active listeners
  • currentSlide - index of the current active slide (read only)

Browser support

  • IE10
  • Chrome 12
  • Firefox 16
  • Opera 15
  • Safari 4
  • Android Browser 4.0
  • iOS Safari 6.0

Keywords

FAQs

Package last updated on 14 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc