A lightweight carousel library with fluid motion and great swipe precision.
MIT License
Bot releases are visible (Hide)
Published by davidjerleke 9 months ago
v8.0.0-rc01
- v8.0.0-rc19
this release includes the following:Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
embla-carousel
as a dependency for CodeSandbox template by @zaaakher in https://github.com/davidjerleke/embla-carousel/pull/685
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc19...v8.0.0-rc20
Published by davidjerleke 10 months ago
v8.0.0-rc01
- v8.0.0-rc18
this release includes the following:Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
onBeforeUnmount
instead of onUnmounted
to separate embla DOM cleanup from Vue Reactivity by @sadeghbarati in https://github.com/davidjerleke/embla-carousel/pull/673
CONTRIBUTING.md
to root directory by @zaaakher in https://github.com/davidjerleke/embla-carousel/pull/681
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc18...v8.0.0-rc19
Published by davidjerleke 10 months ago
v8.0.0-rc01
- v8.0.0-rc17
this release includes the following:Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc17...v8.0.0-rc18
Published by davidjerleke 10 months ago
π οΈ Bugfixes:
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc16...v8.0.0-rc17
Published by davidjerleke 10 months ago
v8.0.0-rc15
is strongly recommended to upgrade to this version.π οΈ Bugfixes:
EmblaOptionsType
doesn't exists in React. Thanks @proninyaroslav!Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc15...v8.0.0-rc16
Published by davidjerleke 11 months ago
align:number
with a callback. Thanks @tobimori!π οΈ Bugfixes:
slidesInView
memory leak - Not destroyed when carousel is dismantled. Thanks @fcasibu!containScroll:'trimSnaps'
option is set. Thanks @sarussss!Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
align:number
with a callback by @davidjerleke in https://github.com/davidjerleke/embla-carousel/pull/595
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc14...v8.0.0-rc15
Published by davidjerleke about 1 year ago
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc13...v8.0.0-rc14
Published by davidjerleke about 1 year ago
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc12...v8.0.0-rc13
Published by davidjerleke about 1 year ago
emblaApi.slidesInView()
should use IntersectionObserver.slidesToScroll: 'auto'
isn't compatible with margins or gap slide spacings.Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc11...v8.0.0-rc12
Published by davidjerleke over 1 year ago
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc10...v8.0.0-rc11
Published by davidjerleke over 1 year ago
#504 - βοΈ Carousel Generator
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Published by davidjerleke over 1 year ago
containScroll
option default is now: 'trimSnaps'
. Thanks @MaxDesignFR.Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
containScroll: 'trimSnaps'
default by @davidjerleke in https://github.com/davidjerleke/embla-carousel/pull/524
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc08...v8.0.0-rc09
Published by davidjerleke over 1 year ago
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc07...v8.0.0-rc08
Published by davidjerleke over 1 year ago
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc06...v8.0.0-rc07
Published by davidjerleke over 1 year ago
active: false
. Thanks @turtlecrab!Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc05...v8.0.0-rc06
Published by davidjerleke over 1 year ago
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc04...v8.0.0-rc05
Published by davidjerleke over 1 year ago
Embla now works in different realms like iframes and windows. Additionally, before this release, each carousel started a separate animation loop by calling requestAnimationFrame
. With this release, all carousels within the same realm now share the same animation loop.
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc03...v8.0.0-rc04
Published by davidjerleke over 1 year ago
dragThreshold
configurable.Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
dragThreshold
option by @davidjerleke in https://github.com/davidjerleke/embla-carousel/pull/469
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc02...v8.0.0-rc03
Published by davidjerleke over 1 year ago
embla-carousel-svelte
users.embla-carousel-svelte
init event types.β Don't do this anymore:
<script lang="ts">
import emblaCarouselSvelte, type { EmblaCarouselType } from 'embla-carousel-svelte'
let emblaApi: EmblaCarouselType
function onInit(event: CustomEvent<EmblaCarouselType>): void {
emblaApi = event.detail
console.log(emblaApi.slideNodes()) // Access API
}
</script>
<div class="embla" use:emblaCarouselSvelte init="{onInit}"> β
...
</div>
β The new way to do it:
<script lang="ts">
import emblaCarouselSvelte, type { EmblaCarouselType } from 'embla-carousel-svelte'
let emblaApi: EmblaCarouselType
function onInit(event: CustomEvent<EmblaCarouselType>): void {
emblaApi = event.detail
console.log(emblaApi.slideNodes()) // Access API
}
</script>
<div class="embla" use:emblaCarouselSvelte emblaInit="{onInit}"> β
...
</div>
Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v8.0.0-rc01...v8.0.0-rc02
Published by davidjerleke over 1 year ago
Object.assign()
polyfill away. With the v8.0.0
release, Embla uses modern browser features so if there are any devs out there that still need to support IE11, this version of Embla isn't for you.Thanks to a generous anonymous donation, I was able to spend two and a half days on this project, instead of 15 minutes here and there of my worst time during a day. The result - All the following improvements without any increase in bundle size!
Please note that although this is a pre-release, the changes in this release are here to stay. However, I might choose to include a little more in the final v8.0.0 release.
A new physics engine
Embla animations are now frame rate independent! No matter if your screen has a refresh rate of 30Hz, 60Hz, 120Hz or anything else, the animation durations will be the same.
I've replaced the old attraction physics model with a new more flexible one. The previous model was hard to reason with. In contrast, the new attraction model feels more natural. The speed of scrolling is now always proportional to how vigorous the drag gestures are.
The new watch concept
This release introduces the new watch concept. Devs now have three new options:
watchResize
and watchSlides
options (thanks @ej-mitchell)watchDrag
option (thanks @peacepostman)watchResize
Embla is no longer listening to the window resize
event. Instead, it's using ResizeObserver on its container and slides. If any size has changed it will re-initialize by calling reInit
automatically. Default is:
{
watchResize: true,
}
You can opt out of the default Embla resize behaviour like so:
{
watchResize: false,
}
However, you can also pass a callback function to watchResize
like so:
{
watchResize: (emblaApi: EmblaCarouselType, entries: ResizeObserverEntry[]) => {
// do your own thing here BEFORE Embla runs its internal resize logic
return true // <-- Return true if you want Embla to continue with its default resize behaviour
// ...OR:
return false // <-- Return false if you want Embla to skip its default resize behaviour
},
}
watchSlides
This new option adds the feature of Embla automatically re-initializing by calling reInit
when slides have been added or removed, using MutationObserver. Default is:
{
watchSlides: true,
}
You can opt out of the default Embla slides changed behaviour like so:
{
watchSlides: false,
}
However, you can also pass a callback function to watchSlides
like so:
{
watchSlides: (emblaApi: EmblaCarouselType, mutations: MutationRecord[]) => {
// do your own thing here BEFORE Embla runs its internal slides changed logic
return true // <-- Return true if you want Embla to continue with its default slides changed behaviour
// ...OR:
return false // <-- Return false if you want Embla to skip its default slides changed behaviour
},
}
watchDrag
This new option adds the possibility to cancel the default drag behaviour. For example, it's useful if you need to disable dragging when a user wants to scroll an element inside a slide. Default is:
{
watchDrag: true,
}
You can opt out of the default Embla drag behaviour like so:
{
watchDrag: false,
}
However, you can also pass a callback function to watchDrag
like so:
{
watchDrag: (emblaApi: EmblaCarouselType, event: MouseEvent |Β TouchEvent) => {
// do your own thing here BEFORE Embla runs its internal drag logic
return true // <-- Return true if you want Embla to continue with its default drag behaviour
// ...OR:
return false // <-- Return false if you want Embla to skip its default drag behaviour
},
}
watchDrag
option (was named draggable
before this release) (thanks @peacepostman)emblaApi
as a first parameter to event listenersspeed
option is now duration
)containScroll
options has changed from ''
--> null
.clickAllowed()
method has been removed because it's now handled automatically.Embla Carousel is an open source MIT licensed project. If you are interested in supporting this project, please consider:
watchResize
and watchSlides
options by @davidjerleke in https://github.com/davidjerleke/embla-carousel/pull/449
watchDrag
option by @davidjerleke in https://github.com/davidjerleke/embla-carousel/pull/461
emblaApi
as a first parameter to event listeners by @davidjerleke in https://github.com/davidjerleke/embla-carousel/pull/463
Full Changelog: https://github.com/davidjerleke/embla-carousel/compare/v7.1.0...v8.0.0-rc01