github davidjerleke/embla-carousel v4.1.0
v4.1.0 - RTL Support

latest releases: v8.6.0, v8.5.2, v8.5.1...
5 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!

Don't miss a new embla-carousel release

NewReleases is sending notifications on new releases.