Quick start
Build your first slider in five minutes.
1. Add the markup
A slider is a container with a track and slides. Any element can be a slide.
index.html
<div class="orbit" id="gallery" aria-label="Product photos">
<div class="orbit-track">
<div class="orbit-slide"><img src="one.jpg" alt="The red chair"></div>
<div class="orbit-slide"><img src="two.jpg" alt="The chair from the side"></div>
<div class="orbit-slide"><img src="three.jpg" alt="The chair in a room"></div>
</div>
</div>2. Start Orbit
main.js
import Orbit from 'orbit-js'
new Orbit('#gallery', { perView: 1, arrows: true, dots: true })3. Make it responsive
Use breakpoints to change options as the screen gets wider.
js
new Orbit('#gallery', {
perView: 1,
breakpoints: {
640: { perView: 2 },
1024: { perView: 3, gap: 24 },
},
})Mobile first. Breakpoints are minimum widths, like CSS media queries.
What next?
See every setting in Options, or control the slider from your own code with the API.