Create nice, simple and fully customizable slideshow.
- Maintain attributes on elements for easy styling
active
: Attribute on the active slidefirst
: Attribute on the first slidelast
: Attribute on the last slideprevious
: Attribute on the previous slidenext
: Attribute on the next slidebefore-active
: Attribute on each slides that are before the active oneafter-active
: Attribute on each slides that are after the active oneslide="{idx}"
: Attribute on the slideshow itself that set the active slideslides-per-change="{x}"
: Attribute on the slideshow itself that set the number of slides to pass on change
- Nice and easy API
- And more...
- Demo
- Install
- Get Started
- Javascript API
- SASS API
- Sugar Web Components Documentation
- Browsers support
- Contribute
- Who are Coffeekraken?
- Licence
npm install coffeekraken-s-slideshow-component --save
First, import the component into your javascript file like so:
import SSlideshowComponent from 'coffeekraken-s-slideshow-component'
Then simply use it inside your html like so:
<s-slideshow class="ratio-16-9 m-b" loop>
<div s-slideshow-slide>
<img class="abs-cover" src="https://source.unsplash.com/category/buildings/800x600" />
</div>
<div s-slideshow-slide active>
<img class="abs-cover" src="https://source.unsplash.com//category/food/800x600" />
</div>
<div s-slideshow-slide>
<img class="abs-cover" src="https://source.unsplash.com//category/people/800x600" />
</div>
<div s-slideshow-slide>
<img class="abs-cover" src="https://source.unsplash.com//category/nature/800x600" />
</div>
</s-slideshow>
If you need some styling to start with, you can generate it like so:
@import 'node_modules/coffeekraken-s-slideshow-component/index';
// only a base bare styling
@include s-slideshow-classes-bare();
// ...and optionally the visual styles
@include s-slideshow-classes-style();
// ...or generate directly the bare and style classes
@include s-slideshow-classes();
IE / Edge |
Firefox |
Chrome |
Safari |
---|---|---|---|
IE11+ | last 2 versions | last 2 versions | last 2 versions |
As browsers are automatically updated, we will keep as reference the last two versions of each but this component can work on older ones as well.
The webcomponent API (custom elements, shadowDOM, etc...) is not supported in some older browsers like IE10, etc... In order to make them work, you will need to integrate the corresponding polyfill.
This is an open source project and will ever be! You are more that welcomed to contribute to his development and make it more awesome every day. To do so, you have several possibilities:
We try to be some cool guys that build some cool tools to make our (and yours hopefully) every day life better.
The code is available under the MIT license. This mean that you can use, modify, or do whatever you want with it. This mean also that it is shipped to you for free, so don't be a hater and if you find some issues, etc... feel free to contribute instead of sharing your frustrations on social networks like an asshole...