Embla Carousel v4.1.0 Release Notes
Release Date: 2020-11-11 // over 3 years ago-
🍱 🌟 New Features
This release comes with RTL (Right To Left) support (#43) for Embla. Special thanks to @omarkhatibco and @ppromerojr for all the help. And good news! This feature doesn't add any weight to the Embla library. It actually comes with a slightly reduced bundle size.
Usage
🔧 The options object is configured like so:
const emblaNode = document.getElementById('embla')const options = { direction: 'rtl' } // Default is 'ltr'const embla = EmblaCarousel(emblaNode, options)
The HTML direction also has to be set to RTL. This can be achieved by using the HTML dir attribute:
\<div class="embla" id="embla" dir="rtl"\> ...\</div\>
...or using the CSS direction property:
.embla { direction: rtl; }
CodeSandboxes
I've added the following two sandboxes to the examples page to get you started:
Enjoy!