Swiped is based on Flexbox and CSS Scroll Snap and can operate completely without JS (No arrow support)
Swiped is based on Flexbox and CSS Scroll Snap and can operate completely without JS (No arrow support)
Using Swiped can be as simple as a single CSS Include!
Swiped has a very simple markup, you just need a container, body, items and tell it how many columns you want.
<div class="swiped" data-swiped-item-count="2">
<div class="swiped-items">
<div class="swiped-item">
<img src="https://picsum.photos/200/400?1">
</div>
<div class="swiped-item">
<p>Hello</p>
</div>
<div class="swiped-item">
<img src="https://picsum.photos/200/400?3">
</div>
...
</div>
</div>
Swiped responsive columns are mobile first, so if you only set the default, all devices will see the same.
<div class="swiped" data-swiped-item-count="5">
<div class="swiped"
data-swiped-item-count="3"
data-swiped-item-count-desktop="5">
<div class="swiped"
data-swiped-item-count="2"
data-swiped-item-count-tablet="3"
data-swiped-item-count-desktop="6">
Although spacing is great, sometimes you may want to remove spacing altogether.
<div class="swiped swiped-is-gapless" data-swiped-item-count="5">
<div class="swiped swiped-is-gapless-tablet" data-swiped-item-count="5">
<div class="swiped swiped-is-gapless-mobile" data-swiped-item-count="5">
The best way to show that an element can be swiped on mobile is to have a preview of the next item.
<div class="swiped swiped-has-preview" data-swiped-item-count="5">
<div class="swiped swiped-has-preview-tablet" data-swiped-item-count="5">
<div class="swiped swiped-has-preview-mobile" data-swiped-item-count="5">
Gaps are great but sometimes you also want them on the outside. This property adds a gap to both the left and right.
<div class="swiped swiped-has-padding" data-swiped-item-count="5">
<div class="swiped swiped-has-padding-tablet" data-swiped-item-count="5">
<div class="swiped swiped-has-padding-mobile" data-swiped-item-count="5">
Get the best of both worlds by combining an item preview and left side padding for the ultimate mobile preview.
<div class="swiped swiped-has-padded-preview" data-swiped-item-count="5">
<div class="swiped swiped-has-padded-preview-tablet" data-swiped-item-count="5">
<div class="swiped swiped-has-padded-preview-mobile" data-swiped-item-count="5">
So you love gapless and love previews, no problems we have you covered.
<div class="swiped swiped-has-gapless-preview" data-swiped-item-count="5">
<div class="swiped swiped-has-gapless-preview-tablet" data-swiped-item-count="5">
<div class="swiped swiped-has-gapless-preview-mobile" data-swiped-item-count="5">
We decided to let you do what you like when it comes to controlling. That's why we just provide support for a data attribute.
<div class="swiped" id="swiped2" data-swiped-item-count="5"> // Add an ID to your Swiped container.
<button data-swiped-back="swiped2">Back</button> // Add data-swiped-back to something with the Swiped ID.
<button data-swiped-next="swiped2">Next</button> // Add data-swiped-next to something with the Swiped ID.