Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / packages/content/data/unofficial/embla-carousel/llms-full.txt |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | packages/content/data/unofficial/embla-carousel/llms-full.txt |
| Original SHA-256 | f2ada3e9abec81e85d9591a137f8305ff0cb2ddb145f20a4ae87f9e65bb5111c |
| Git blob SHA | 7c88d94674cdfae844a7cca2a9e19607ee139d2d |
| Reading-copy SHA-256 | f2ada3e9abec81e85d9591a137f8305ff0cb2ddb145f20a4ae87f9e65bb5111c |
Recovered source transcript
Download complete source text ↓4,263 lines · 146.4 KB
# https://www.embla-carousel.com/ llms-full.txt
## Embla Carousel
[Skip to content](https://www.embla-carousel.com/#main-content)

# EmblaCarousel
## A lightweight carousel library with fluid motion and great swipe precision
- [Examples](https://www.embla-carousel.com/examples/predefined/)
- [Generator](https://www.embla-carousel.com/examples/generator/)
- [**Highly Extensible** \\
\\
An API designed with flexibility and extensibility in mind.\\
\\
Read more](https://www.embla-carousel.com/api/)
- [**Plugin System** \\
\\
Add functionality and customize your carousels as you go.\\
\\
Read more](https://www.embla-carousel.com/plugins/)
- [**Carousel generator** \\
\\
Create your own customized carousel in no time.\\
\\
Read more](https://www.embla-carousel.com/examples/generator/)
## Embla Carousel Plugins
[Skip to content](https://www.embla-carousel.com/plugins/#main-content)
# Plugins
Here is a list of available Embla Carousel plugins that will **extend your carousels** with additional features, that goes beyond the built-in Embla Carousel core features.
* * *
## [choose a plugin permalink](https://www.embla-carousel.com/plugins/\#choose-a-plugin) Choose a plugin
- [**Autoplay** \\
\\
Learn how to use the Autoplay plugin for Embla Carousel\\
\\
Read more](https://www.embla-carousel.com/plugins/autoplay/)
- [**Auto Scroll** \\
\\
Learn how to use the Auto Scroll plugin for Embla Carousel\\
\\
Read more](https://www.embla-carousel.com/plugins/auto-scroll/)
- [**Auto Height** \\
\\
Learn how to use the Auto Height plugin for Embla Carousel\\
\\
Read more](https://www.embla-carousel.com/plugins/auto-height/)
- [**Class Names** \\
\\
Learn how to use the Class Names plugin for Embla Carousel\\
\\
Read more](https://www.embla-carousel.com/plugins/class-names/)
- [**Fade** \\
\\
Learn how to use the Fade plugin for Embla Carousel\\
\\
Read more](https://www.embla-carousel.com/plugins/fade/)
- [**Wheel Gestures** \\
\\
Learn how to add this Wheel Gesture plugin to Embla Carousel\\
\\
Read more](https://www.embla-carousel.com/plugins/wheel-gestures/)
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/plugins/index.mdx)
## Embla Carousel Guides
[Skip to content](https://www.embla-carousel.com/guides/#main-content)
# Practical Guides
Here is a list of practical step-by-step guides to help you achieve a specific goal. These guides demonstrate how to **customize your carousels** for different use cases and teach you more about how Embla Carousel works.
* * *
## [pick a guide permalink](https://www.embla-carousel.com/guides/\#pick-a-guide) Pick a guide
- [**Slide Container** \\
\\
This guide demonstrates how to setup the Embla Carousel slide container correctly.\\
\\
Read more](https://www.embla-carousel.com/guides/slide-container/)
- [**Slide Sizes** \\
\\
This guide demonstrates how Embla Carousel handles slide sizes and how to customize them.\\
\\
Read more](https://www.embla-carousel.com/guides/slide-sizes/)
- [**Slide Gaps** \\
\\
This guide demonstrates how Embla Carousel handles slide gaps and how to customize them.\\
\\
Read more](https://www.embla-carousel.com/guides/slide-gaps/)
- [**Breakpoints** \\
\\
This guide demonstrates how to customize Embla Carousel based on different breakpoints.\\
\\
Read more](https://www.embla-carousel.com/guides/breakpoints/)
- [**Prev & Next Buttons** \\
\\
This guide demonstrates how to setup previous and next buttons using the Embla Carousel API.\\
\\
Read more](https://www.embla-carousel.com/guides/previous-and-next-buttons/)
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/guides/index.mdx)
## Embla Carousel API
[Skip to content](https://www.embla-carousel.com/api/#main-content)
# API
A lightweight carousel shouldn't be limited to just its core features. That's why the Embla Carousel API is **designed** with **extensibility in mind**, and it exposes a **rich API** that can **easily be extended** to cover most of the use cases for carousels.
* * *
## [explore the api permalink](https://www.embla-carousel.com/api/\#explore-the-api) Explore the API
- [**Options** \\
\\
Discover how to customize Embla Carousel with its available options.\\
\\
Read more](https://www.embla-carousel.com/api/options/)
- [**Methods** \\
\\
Explore Embla Carousel methods useful for extending the carousel beyond its native functionality.\\
\\
Read more](https://www.embla-carousel.com/api/methods/)
- [**Events** \\
\\
Learn how to listen to Embla Carousel events and how to make use of them.\\
\\
Read more](https://www.embla-carousel.com/api/events/)
- [**Plugins** \\
\\
Learn how to add plugins to Embla Carousel and extend it.\\
\\
Read more](https://www.embla-carousel.com/api/plugins/)
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/api/index.mdx)
## Embla Carousel Examples
[Skip to content](https://www.embla-carousel.com/examples/#main-content)
# Example Setups
Get started instantly with Embla Carousel by finding an example setup that suits your needs. All examples are generated using the [CodeSandbox](https://codesandbox.io/) API.
* * *
## [choose type of examples permalink](https://www.embla-carousel.com/examples/\#choose-type-of-examples) Choose type of examples
- [**Predefined** \\
\\
Browse predefined Embla Carousel setups that demonstrates its features.\\
\\
Read more](https://www.embla-carousel.com/examples/predefined/)
- [**Generator** \\
\\
Generate and customize your own Embla Carousel setup.\\
\\
Read more](https://www.embla-carousel.com/examples/generator/)
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/examples/index.mdx)
## Embla Autoplay Plugin
[Skip to content](https://www.embla-carousel.com/plugins/autoplay/#main-content)
# Autoplay
[View plugin on GitHub](https://github.com/davidjerleke/embla-carousel/tree/master/packages/embla-carousel-autoplay)
This plugin is used to extend Embla Carousel with **autoplay** functionality.
* * *
## [example permalink](https://www.embla-carousel.com/plugins/autoplay/\#example) Example
Edit Code
1
2
3
4
5
Start
## [installation permalink](https://www.embla-carousel.com/plugins/autoplay/\#installation) Installation
Start by installing the **npm package** and save it to your dependencies:
CDNCDNnpmnpmyarnyarn
Copy code snippet to clipboardCopy
```prism-code html
<script src="https://unpkg.com/embla-carousel-autoplay/embla-carousel-autoplay.umd.js"></script>
```
Copy code snippet to clipboardCopy
```prism-code shell
npm install embla-carousel-autoplay --save
```
Copy code snippet to clipboardCopy
```prism-code shell
yarn add embla-carousel-autoplay
```
## [options permalink](https://www.embla-carousel.com/plugins/autoplay/\#options) Options
Below follows an exhaustive **list of all** `Autoplay` **options** and their default values.
* * *
### [delay permalink](https://www.embla-carousel.com/plugins/autoplay/\#delay) delay
Type: `number | (scrollSnapList: number[], emblaApi: EmblaCarouselType) => number[]`
Default: `4000`
Choose a delay between transitions in milliseconds. If you pass a number, the same delay will be **applied to all transitions**. If you pass a function, you can return an array of numbers based on the `scrollSnapList` parameter and set **different delays for each scroll snap**.
* * *
### [jump permalink](https://www.embla-carousel.com/plugins/autoplay/\#jump) jump
Type: `boolean`
Default: `false`
When set to true `true`, autoplay will do instant slide transitions when advancing.
* * *
### [playoninit permalink](https://www.embla-carousel.com/plugins/autoplay/\#playoninit) playOnInit
Type: `boolean`
Default: `true`
If set to `false`, you'll have to start autoplay manually by calling the [play](https://www.embla-carousel.com/plugins/autoplay/#play) method. It's useful to set this to `false` when you want full control over the timing. For example, when building an autoplay progress bar.
* * *
### [stoponinteraction permalink](https://www.embla-carousel.com/plugins/autoplay/\#stoponinteraction) stopOnInteraction
Type: `boolean`
Default: `true`
If set to `false`, autoplay will not be disabled after drag interactions, and it will restart every time after an interaction.
* * *
### [stoponmouseenter permalink](https://www.embla-carousel.com/plugins/autoplay/\#stoponmouseenter) stopOnMouseEnter
Type: `boolean`
Default: `false`
When enabled, autoplay will stop when a mouse pointer enters the Embla Carousel container. If [stopOnInteraction](https://www.embla-carousel.com/plugins/autoplay/#stoponinteraction) is also `false`, autoplay will resume when the mouse leaves the carousel container.
* * *
### [stoponfocusin permalink](https://www.embla-carousel.com/plugins/autoplay/\#stoponfocusin) stopOnFocusIn
Type: `boolean`
Default: `true`
When enabled, autoplay will stop when a focusable element inside the carousel recieves focus. If [stopOnInteraction](https://www.embla-carousel.com/plugins/autoplay/#stoponinteraction) is `false`, autoplay will resume when the user leaves focus.
* * *
### [stoponlastsnap permalink](https://www.embla-carousel.com/plugins/autoplay/\#stoponlastsnap) stopOnLastSnap
Type: `boolean`
Default: `false`
If this parameter is enabled, autoplay will stop when it reaches last slide.
* * *
### [rootnode permalink](https://www.embla-carousel.com/plugins/autoplay/\#rootnode) rootNode
Type: `(emblaRoot: HTMLElement) => HTMLElement | null`
Default: `null`
The **node** that should **respond** to user **interactions** like [stopOnMouseEnter](https://www.embla-carousel.com/plugins/autoplay/#stoponmouseenter) and [stopOnInteraction](https://www.embla-carousel.com/plugins/autoplay/#stoponinteraction). If this is omitted, the node that wraps the Embla Carousel will be used as default.
* * *
## [methods permalink](https://www.embla-carousel.com/plugins/autoplay/\#methods) Methods
Below follows an exhaustive **list of all** `Autoplay` **methods** with their respective parameters and return values.
* * *
### [play permalink](https://www.embla-carousel.com/plugins/autoplay/\#play) play
Parameters: `jump?: boolean`
Returns: `void`
Start autoplay. Set the **jump** parameter to `true` when you want autoplay to do instant slide transitions when advancing. Please note that providing a value to this method vill override the [jump](https://www.embla-carousel.com/plugins/autoplay/#jump) option.
* * *
### [stop permalink](https://www.embla-carousel.com/plugins/autoplay/\#stop) stop
Parameters: `none`
Returns: `void`
Stop autoplay.
* * *
### [reset permalink](https://www.embla-carousel.com/plugins/autoplay/\#reset) reset
Parameters: `none`
Returns: `void`
Resets the timer and starts over. This will only take effect if autoplay is already active. If autoplay is stopped, this method won't do anything.
* * *
### [isplaying permalink](https://www.embla-carousel.com/plugins/autoplay/\#isplaying) isPlaying
Parameters: `none`
Returns: `boolean`
Returns a boolean whether autoplay is playing or not.
* * *
### [timeuntilnext permalink](https://www.embla-carousel.com/plugins/autoplay/\#timeuntilnext) timeUntilNext
Parameters: `none`
Returns: `number | null`
If the autoplay timer is active, this will return a number representing the time left until the autoplay scrolls to the next snap. If the timer is not active, this will return `null`. Use this together with the [autoplay:timerset](https://www.embla-carousel.com/plugins/autoplay/#autoplaytimerset) and [autoplay:timerstopped](https://www.embla-carousel.com/plugins/autoplay/#autoplaytimerstopped) events to create a custom progress bar for autoplay.
If you're using a reactive wrapper for Embla Carousel like
`embla-carousel-react` and building an autoplay progress bar, you probably
want to set [playOnInit](https://www.embla-carousel.com/plugins/autoplay/#playoninit) to `false` and call
the `play` method manually to fully control the timing.
This is because the autoplay plugin will start playing as soon as it's
initialized, which might not be what you want in these cases.
* * *
## [events permalink](https://www.embla-carousel.com/plugins/autoplay/\#events) Events
Below follows an exhaustive **list of all** `Autoplay` **events** together with information about how they work.
* * *
### [autoplayplay permalink](https://www.embla-carousel.com/plugins/autoplay/\#autoplayplay) autoplay:play
Once: `no`
Fires when autoplay starts playing. When this event is triggered, the **autoplay timer is active**, and autoplay will select the next scroll snap and start scrolling to it when the [delay](https://www.embla-carousel.com/plugins/autoplay/#delay) has passed.
* * *
### [autoplaystop permalink](https://www.embla-carousel.com/plugins/autoplay/\#autoplaystop) autoplay:stop
Once: `no`
Fires when autoplay stops playing. When this event is triggered, the **autoplay timer is not active anymore**.
* * *
### [autoplayselect permalink](https://www.embla-carousel.com/plugins/autoplay/\#autoplayselect) autoplay:select
Once: `no`
Fires directly after autoplay selects the next scroll snap and starts scrolling to it.
* * *
### [autoplaytimerset permalink](https://www.embla-carousel.com/plugins/autoplay/\#autoplaytimerset) autoplay:timerset
Once: `no`
Fires when the autoplay timer is set. As soon as the timer is set, countdown to autoplay to the next scroll snap will begin.
* * *
### [autoplaytimerstopped permalink](https://www.embla-carousel.com/plugins/autoplay/\#autoplaytimerstopped) autoplay:timerstopped
Once: `no`
Fires when the autoplay timer is stopped.
* * *
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/plugins/autoplay.mdx)
## Embla Carousel Methods
[Skip to content](https://www.embla-carousel.com/api/methods/#main-content)
# Methods
Embla Carousel exposes a set of **useful methods** which makes it very **extensible**.
* * *
## [usage permalink](https://www.embla-carousel.com/api/methods/\#usage) Usage
You need an **initialized carousel** in order to **make use of methods**. They can be accessed during the lifecycle of a carousel and won't do anything after a carousel instance has been destroyed with the [destroy](https://www.embla-carousel.com/api/methods/#destroy) method.
### [calling methods permalink](https://www.embla-carousel.com/api/methods/\#calling-methods) Calling methods
In the following example, the [slideNodes](https://www.embla-carousel.com/api/methods/#slidenodes) method is called and logged to the console as soon as the carousel has been initialized:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code js
import EmblaCarousel from 'embla-carousel'
const emblaNode = document.querySelector('.embla')const emblaApi = EmblaCarousel(emblaNode)
console.log(emblaApi.slideNodes())
```
Copy code snippet to clipboardCopy
```prism-code jsx
import { useEffect } from 'react'import useEmblaCarousel from 'embla-carousel-react'
export function EmblaCarousel() { const [emblaRef, emblaApi] = useEmblaCarousel()
useEffect(() => { if (emblaApi) console.log(emblaApi.slideNodes()) }, [emblaApi])
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script setup> import { onMounted } from 'vue' import emblaCarouselVue from 'embla-carousel-vue'
const [emblaRef, emblaApi] = emblaCarouselVue()
onMounted(() => { if (emblaApi.value) console.log(emblaApi.value.slideNodes()) })
// ...</script>
```
Copy code snippet to clipboardCopy
```prism-code jsx
import { onMount } from 'solid-js'import createEmblaCarousel from 'embla-carousel-solid'
export function EmblaCarousel() { const [emblaRef, emblaApi] = createEmblaCarousel()
onMount(() => { const api = emblaApi() if (api) console.log(api.slideNodes()) })
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script> import emblaCarouselSvelte from 'embla-carousel-svelte'
let emblaApi
function onInit(event) { emblaApi = event.detail console.log(emblaApi.slideNodes()) }</script>
<div class="embla" use:emblaCarouselSvelte onemblaInit="{onInit}">...</div>
```
**Note:** Starting with Svelte 5, the `on:` event handlers have been deprecated. However, `on:emblaInit` will remain for backward compatibility.
### [typescript permalink](https://www.embla-carousel.com/api/methods/\#typescript) TypeScript
The `EmblaCarouselType` is obtained directly from the **core package** `embla-carousel` and used like so:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code tsx
import EmblaCarousel, { EmblaCarouselType } from 'embla-carousel'
const emblaNode = document.querySelector('.embla')const emblaApi = EmblaCarousel(emblaNode)
function logSlidesInView(emblaApi: EmblaCarouselType): void { console.log(emblaApi.slidesInView())}
emblaApi.on('slidesInView', logSlidesInView)
```
Copy code snippet to clipboardCopy
```prism-code tsx
import React, { useCallback } from 'react'import { EmblaCarouselType } from 'embla-carousel'import useEmblaCarousel from 'embla-carousel-react'
export function EmblaCarousel() { const [emblaRef, emblaApi] = useEmblaCarousel()
const logSlidesInView = useCallback((emblaApi: EmblaCarouselType) => { console.log(emblaApi.slidesInView()) }, [])
useEffect(() => { if (emblaApi) emblaApi.on('slidesInView', logSlidesInView) }, [emblaApi, logSlidesInView])
// ...}
```
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-react` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
Copy code snippet to clipboardCopy
```prism-code html
<script setup lang="ts"> import { onMounted } from 'vue' import { EmblaCarouselType } from 'embla-carousel' import emblaCarouselVue from 'embla-carousel-vue'
const [emblaRef] = emblaCarouselVue()
function logSlidesInView(emblaApi: EmblaCarouselType): void { console.log(emblaApi.slidesInView()) }
onMounted(() => { if (emblaApi.value) emblaApi.value.on('slidesInView', logSlidesInView) })
// ...</script>
```
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-vue` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
Copy code snippet to clipboardCopy
```prism-code jsx
import { onMount } from 'solid-js'import { EmblaCarouselType } from 'embla-carousel'import createEmblaCarousel from 'embla-carousel-solid'
export function EmblaCarousel() { const [emblaRef, emblaApi] = createEmblaCarousel()
function logSlidesInView(emblaApi: EmblaCarouselType): void { console.log(emblaApi.slidesInView()) }
onMount(() => { const api = emblaApi() if (api) api.on('slidesInView', logSlidesInView) })
// ...}
```
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-solid` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
Copy code snippet to clipboardCopy
```prism-code html
<script> import { EmblaCarouselType } from 'embla-carousel' import emblaCarouselSvelte from 'embla-carousel-svelte'
let emblaApi: EmblaCarouselType
function logSlidesInView(emblaApi: EmblaCarouselType): void { console.log(emblaApi.slidesInView()) }
function onInit(event: CustomEvent<EmblaCarouselType>): void { emblaApi = event.detail emblaApi.on('slidesInView', logSlidesInView) }</script>
<div class="embla" use:emblaCarouselSvelte onemblaInit="{onInit}">...</div>
```
**Note:** Starting with Svelte 5, the `on:` event handlers have been deprecated. However, `on:emblaInit` will remain for backward compatibility.
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-svelte` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
## [reference permalink](https://www.embla-carousel.com/api/methods/\#reference) Reference
Below follows an exhaustive **list of all** Embla Carousel **methods** with their respective parameters and return values.
* * *
### [rootnode permalink](https://www.embla-carousel.com/api/methods/\#rootnode) rootNode
Parameters: `none`
Returns: `HTMLElement`
Get the root node that holds the scroll container with slides inside. This method can be useful when you need to manipulate the root element dynamically or similar.
* * *
### [containernode permalink](https://www.embla-carousel.com/api/methods/\#containernode) containerNode
Parameters: `none`
Returns: `HTMLElement`
Get the container node that holds the slides. This method can be useful when you need to manipulate the container element dynamically or similar.
* * *
### [slidenodes permalink](https://www.embla-carousel.com/api/methods/\#slidenodes) slideNodes
Parameters: `none`
Returns: `HTMLElement[]`
Get all the slide nodes inside the container. This method can be useful when you need to manipulate the slide elements dynamically or similar.
* * *
### [scrollnext permalink](https://www.embla-carousel.com/api/methods/\#scrollnext) scrollNext
Parameters: `jump?: boolean`
Returns: `void`
Scroll to the next snap point if possible. When [loop](https://www.embla-carousel.com/api/options/#loop) is disabled and the carousel has reached the last snap point, this method won't do anything. Set the **jump** parameter to `true` when you want to go to the next slide instantly.
* * *
### [scrollprev permalink](https://www.embla-carousel.com/api/methods/\#scrollprev) scrollPrev
Parameters: `jump?: boolean`
Returns: `void`
Scroll to the previous snap point if possible. When [loop](https://www.embla-carousel.com/api/options/#loop) is disabled and the carousel has reached the first snap point, this method won't do anything. Set the **jump** parameter to `true` when you want to go to the previous slide instantly.
* * *
### [scrollto permalink](https://www.embla-carousel.com/api/methods/\#scrollto) scrollTo
Parameters: `index: number`, `jump?: boolean`
Returns: `void`
Scroll to a snap point by its unique index. If [loop](https://www.embla-carousel.com/api/options/#loop) is enabled, Embla Carousel will choose the closest way to the target snap point. Set the **jump** parameter to `true` when you want to go to the desired slide instantly.
* * *
### [canscrollnext permalink](https://www.embla-carousel.com/api/methods/\#canscrollnext) canScrollNext
Parameters: `none`
Returns: `boolean`
Check the possiblity to scroll to a next snap point. If [loop](https://www.embla-carousel.com/api/options/#loop) is enabled and the container holds any slides, this will always return `true`.
* * *
### [canscrollprev permalink](https://www.embla-carousel.com/api/methods/\#canscrollprev) canScrollPrev
Parameters: `none`
Returns: `boolean`
Check the possiblity to scroll to a previous snap point. If [loop](https://www.embla-carousel.com/api/options/#loop) is enabled and the container holds any slides, this will always return `true`.
* * *
### [selectedscrollsnap permalink](https://www.embla-carousel.com/api/methods/\#selectedscrollsnap) selectedScrollSnap
Parameters: `none`
Returns: `number`
Get the index of the selected snap point.
* * *
### [previousscrollsnap permalink](https://www.embla-carousel.com/api/methods/\#previousscrollsnap) previousScrollSnap
Parameters: `none`
Returns: `number`
Get the index of the previously selected snap point.
* * *
### [scrollsnaplist permalink](https://www.embla-carousel.com/api/methods/\#scrollsnaplist) scrollSnapList
Parameters: `none`
Returns: `number[]`
Get an array containing all the snap point positions. Each position represents how far the carousel needs to progress in order to reach this position.
* * *
### [scrollprogress permalink](https://www.embla-carousel.com/api/methods/\#scrollprogress) scrollProgress
Parameters: `none`
Returns: `number`
Check how far the carousel has scrolled of its scrollable length from 0 - 1. For example, **0.5 equals 50%**. For example, this can be useful when creating a scroll progress bar.
* * *
### [slidesinview permalink](https://www.embla-carousel.com/api/methods/\#slidesinview) slidesInView
Parameters: `none`
Returns: `number[]`
Get slide indexes **visible** in the carousel viewport. Honors the [inViewThreshold](https://www.embla-carousel.com/api/options/#inviewthreshold) option.
* * *
### [slidesnotinview permalink](https://www.embla-carousel.com/api/methods/\#slidesnotinview) slidesNotInView
Parameters: `none`
Returns: `number[]`
Get slide indexes **not visible** in the carousel viewport. Honors the [inViewThreshold](https://www.embla-carousel.com/api/options/#inviewthreshold) option.
* * *
### [internalengine permalink](https://www.embla-carousel.com/api/methods/\#internalengine) internalEngine
Parameters: `none`
Returns: `EmblaEngineType`
Exposes almost all internal functionality used by Embla. Useful when creating plugins or similar.
**Note:** Please **refrain** from creating **bug reports** related to this
method. If you're using this and running into problems, it's a 99.8% chance
that you don't understand how this works. Use at your own risk.
* * *
### [reinit permalink](https://www.embla-carousel.com/api/methods/\#reinit) reInit
Parameters: `options?: EmblaOptionsType`, `plugins?: EmblaPluginType[]`
Returns: `void`
Hard reset the carousel after it has been initialized. This method allows for changing [options](https://www.embla-carousel.com/api/options/) and [plugins](https://www.embla-carousel.com/api/plugins/) after initializing a carousel.
**Note:** Passed options will be **merged** with current options, but passed
plugins will **replace** current plugins.
* * *
### [plugins permalink](https://www.embla-carousel.com/api/methods/\#plugins) plugins
Parameters: `none`
Returns: `EmblaPluginsType`
Returns an object with key value pairs where the keys are the plugin names, and the plugin API:s are the values.
* * *
### [destroy permalink](https://www.embla-carousel.com/api/methods/\#destroy) destroy
Parameters: `none`
Returns: `void`
Destroy the carousel instance permanently. This is a one way operation and is intended to be used as a cleanup measure when the carousel instance isn't needed anymore.
* * *
### [on permalink](https://www.embla-carousel.com/api/methods/\#on) on
Parameters: `event: EmblaEventType`, `callback: (emblaApi: EmblaCarouselType, eventName: EmblaEventType) => void`
Returns: `void`
**Subscribe** to an Embla specific [event](https://www.embla-carousel.com/api/events/) with a **callback**. Added event listeners will persist even if [reInit](https://www.embla-carousel.com/api/methods/#reinit) is called, either until the carousel is destroyed or the event is removed with the [off](https://www.embla-carousel.com/api/methods/#off) method.
* * *
### [off permalink](https://www.embla-carousel.com/api/methods/\#off) off
Parameters: `event: EmblaEventType`, `callback: (emblaApi: EmblaCarouselType, eventName: EmblaEventType) => void`
Returns: `void`
**Unsubscribe** from an Embla specific [event](https://www.embla-carousel.com/api/events/). Make sure to pass the **same callback reference** when the callback was added with the [on](https://www.embla-carousel.com/api/methods/#on) method.
* * *
### [emit permalink](https://www.embla-carousel.com/api/methods/\#emit) emit
Parameters: `event: EmblaEventType`
Returns: `void`
Emits an embla [event](https://www.embla-carousel.com/api/events/). This doesn't trigger any internal Embla functionality.
* * *
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/api/methods.mdx)
## Embla Carousel Plugins
[Skip to content](https://www.embla-carousel.com/api/plugins/#main-content)
# Plugins
It's possible to **extend** Embla carousel with additional features using **plugins**. The complete list of official plugins can be found [here](https://www.embla-carousel.com/plugins/).
* * *
## [installation permalink](https://www.embla-carousel.com/api/plugins/\#installation) Installation
All **official plugins** are separate **NPM packages**. They're all **prefixed** with `embla-carousel` followed by its **unique** plugin **name**. For example, the `Autoplay` plugin is installed like so:
CDNCDNnpmnpmyarnyarn
Copy code snippet to clipboardCopy
```prism-code html
<script src="https://unpkg.com/embla-carousel-autoplay/embla-carousel-autoplay.umd.js"></script>
```
Copy code snippet to clipboardCopy
```prism-code shell
npm install embla-carousel-autoplay --save
```
Copy code snippet to clipboardCopy
```prism-code shell
yarn add embla-carousel-autoplay
```
## [usage permalink](https://www.embla-carousel.com/api/plugins/\#usage) Usage
The Embla Carousel **constructor** accepts an **array of plugins**. Each plugin might have its own [options](https://www.embla-carousel.com/api/plugins/#constructor-options), [methods](https://www.embla-carousel.com/api/plugins/#calling-methods) and [events](https://www.embla-carousel.com/api/plugins/#adding-event-listeners).
### [adding a plugin permalink](https://www.embla-carousel.com/api/plugins/\#adding-a-plugin) Adding a plugin
The constructor plugin array is the default way of providing plugins to Embla Carousel. In the following example, the [Autoplay](https://www.embla-carousel.com/plugins/autoplay/) plugin is added to the carousel:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code js
import EmblaCarousel from 'embla-carousel'import Autoplay from 'embla-carousel-autoplay'
const emblaNode = document.querySelector('.embla')const embla = EmblaCarousel(emblaNode, { loop: true }, [Autoplay()])
```
Copy code snippet to clipboardCopy
```prism-code jsx
import useEmblaCarousel from 'embla-carousel-react'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef] = useEmblaCarousel({ loop: true }, [Autoplay()])
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script setup> import emblaCarouselVue from 'embla-carousel-vue' import Autoplay from 'embla-carousel-autoplay'
const [emblaRef] = emblaCarouselVue({ loop: true }, [Autoplay()])
// ...</script>
```
Copy code snippet to clipboardCopy
```prism-code jsx
import createEmblaCarousel from 'embla-carousel-solid'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef] = createEmblaCarousel( () => ({ loop: true }), () => [AutoPlay()] )
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script> import emblaCarouselSvelte from 'embla-carousel-svelte' import Autoplay from 'embla-carousel-autoplay'
let plugins = [Autoplay()]</script>
<div class="embla" use:emblaCarouselSvelte="{{ plugins }}">...</div>
```
Note that it's possible to **change plugins** passed to the Embla Carousel
constructor **after initialization** with the [reInit](https://www.embla-carousel.com/api/methods/#reinit)
method.
### [constructor options permalink](https://www.embla-carousel.com/api/plugins/\#constructor-options) Constructor options
Plugins have their own specific **options** which is the first argument of the plugin constructor. This allows for configuring the plugin to your liking:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code js
import EmblaCarousel from 'embla-carousel'import Autoplay from 'embla-carousel-autoplay'
const emblaNode = document.querySelector('.embla')const embla = EmblaCarousel(emblaNode, { loop: true }, [ Autoplay({ delay: 4000 })])
```
Copy code snippet to clipboardCopy
```prism-code jsx
import useEmblaCarousel from 'embla-carousel-react'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef] = useEmblaCarousel({ loop: true }, [ Autoplay({ delay: 4000 }) ])
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script setup> import emblaCarouselVue from 'embla-carousel-vue' import Autoplay from 'embla-carousel-autoplay'
const [emblaRef] = emblaCarouselVue({ loop: true }, [ Autoplay({ delay: 4000 }) ])
// ...</script>
```
Copy code snippet to clipboardCopy
```prism-code jsx
import createEmblaCarousel from 'embla-carousel-solid'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef] = createEmblaCarousel( () => ({ loop: true }), () => [AutoPlay({ delay: 4000 })] )
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script> import emblaCarouselSvelte from 'embla-carousel-svelte' import Autoplay from 'embla-carousel-autoplay'
let plugins = [Autoplay({ delay: 4000 })]</script>
<div class="embla" use:emblaCarouselSvelte="{{ plugins }}">...</div>
```
### [global options permalink](https://www.embla-carousel.com/api/plugins/\#global-options) Global options
All [official plugins](https://www.embla-carousel.com/plugins/) allows you to set **global options** that will be applied to all instances. This allows for overriding the default plugin options with your own:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code js
import EmblaCarousel from 'embla-carousel'import Autoplay from 'embla-carousel-autoplay'
Autoplay.globalOptions = { delay: 4000 }
const emblaNode = document.querySelector('.embla')const embla = EmblaCarousel(emblaNode, { loop: true }, [Autoplay()])
```
Copy code snippet to clipboardCopy
```prism-code jsx
import useEmblaCarousel from 'embla-carousel-react'import Autoplay from 'embla-carousel-autoplay'
Autoplay.globalOptions = { delay: 4000 }
export function EmblaCarousel() { const [emblaRef] = useEmblaCarousel({ loop: true }, [Autoplay()])
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script setup> import emblaCarouselVue from 'embla-carousel-vue' import Autoplay from 'embla-carousel-autoplay'
Autoplay.globalOptions = { delay: 4000 }
const [emblaRef] = emblaCarouselVue({ loop: true }, [Autoplay()])
// ...</script>
```
Copy code snippet to clipboardCopy
```prism-code jsx
import createEmblaCarousel from 'embla-carousel-solid'import Autoplay from 'embla-carousel-autoplay'
Autoplay.globalOptions = { delay: 4000 }
export function EmblaCarousel() { const [emblaRef] = createEmblaCarousel( () => ({ loop: true }), () => [AutoPlay()] )
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script> import emblaCarouselSvelte from 'embla-carousel-svelte' import Autoplay from 'embla-carousel-autoplay'
Autoplay.globalOptions = { delay: 4000 }
let plugins = [Autoplay()]</script>
<div class="embla" use:emblaCarouselSvelte="{{ plugins }}">...</div>
```
Make sure to assign global options **before** initializing any carousel and
**only assign it once**. Re-assigning global options might lead to confusing
code and unexpected behaviour.
### [calling methods permalink](https://www.embla-carousel.com/api/plugins/\#calling-methods) Calling methods
Additionally, some plugins expose their own **API methods**. You can access plugin methods by calling the [plugin](https://www.embla-carousel.com/api/methods/#plugins) method like demonstrated below:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code js
import EmblaCarousel from 'embla-carousel'import Autoplay from 'embla-carousel-autoplay'
const emblaNode = document.querySelector('.embla')const emblaApi = EmblaCarousel(emblaNode, { loop: true }, [Autoplay()])
emblaApi.plugins().autoplay.stop()
```
Copy code snippet to clipboardCopy
```prism-code jsx
import { useEffect } from 'react'import useEmblaCarousel from 'embla-carousel-react'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true }, [Autoplay()])
useEffect(() => { if (emblaApi) emblaApi.plugins().autoplay.stop() }, [emblaApi])
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script setup> import { onMounted } from 'vue' import emblaCarouselVue from 'embla-carousel-vue' import Autoplay from 'embla-carousel-autoplay'
const [emblaRef, emblaApi] = emblaCarouselVue({ loop: true }, [Autoplay()])
onMounted(() => { if (emblaApi.value) emblaApi.value.plugins().autoplay.stop() })
// ...</script>
```
Copy code snippet to clipboardCopy
```prism-code jsx
import { onMount } from 'solid-js'import createEmblaCarousel from 'embla-carousel-solid'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef, emblaApi] = createEmblaCarousel( () => ({ loop: true }), () => [AutoPlay()] )
onMount(() => { const api = emblaApi() if (api) api.plugins().autoplay.stop() })
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script> import emblaCarouselSvelte from 'embla-carousel-svelte' import Autoplay from 'embla-carousel-autoplay'
let emblaApi let plugins = [Autoplay()]
function onInit(event) { emblaApi = event.detail emblaApi.plugins().autoplay.stop() }</script>
<div class="embla" use:emblaCarouselSvelte="{{ plugins }}" onemblaInit="{onInit}"> ...</div>
```
**Note:** Starting with Svelte 5, the `on:` event handlers have been deprecated. However, `on:emblaInit` will remain for backward compatibility.
### [adding event listeners permalink](https://www.embla-carousel.com/api/plugins/\#adding-event-listeners) Adding event listeners
Some plugins fire their own **events**. Plugin events are structured as follows `<plugin-name>:eventname`. [Adding](https://www.embla-carousel.com/api/events/#adding-event-listeners) and [removing](https://www.embla-carousel.com/api/events/#removing-event-listeners) plugin event listeners is done the same way as native Embla events. Here's an example where an event is added to the autoplay plugin:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code js
import EmblaCarousel from 'embla-carousel'import Autoplay from 'embla-carousel-autoplay'
const emblaNode = document.querySelector('.embla')const emblaApi = EmblaCarousel(emblaNode, { loop: true }, [Autoplay()])
function logPluginEvent(emblaApi, eventName) { console.log(`Autoplay just triggered ${eventName}!`)}
emblaApi.on('autoplay:stop', logPluginEvent)
```
Copy code snippet to clipboardCopy
```prism-code jsx
import { useEffect, useCallback } from 'react'import useEmblaCarousel from 'embla-carousel-react'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true }, [Autoplay()])
const logPluginEvent = useCallback((emblaApi, eventName) => { console.log(`Autoplay just triggered ${eventName}!`) }, [])
useEffect(() => { if (emblaApi) emblaApi.on('autoplay:stop', logPluginEvent) }, [emblaApi, logPluginEvent])
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script setup> import { onMounted } from 'vue' import emblaCarouselVue from 'embla-carousel-vue' import Autoplay from 'embla-carousel-autoplay'
const [emblaRef, emblaApi] = emblaCarouselVue({ loop: true }, [Autoplay()])
function logPluginEvent(emblaApi, eventName) { console.log(`Autoplay just triggered ${eventName}!`) }
onMounted(() => { if (emblaApi.value) emblaApi.value.on('autoplay:stop', logPluginEvent) })
// ...</script>
```
Copy code snippet to clipboardCopy
```prism-code jsx
import { onMount } from 'solid-js'import createEmblaCarousel from 'embla-carousel-solid'import Autoplay from 'embla-carousel-autoplay'
export function EmblaCarousel() { const [emblaRef, emblaApi] = createEmblaCarousel( () => ({ loop: true }), () => [AutoPlay()] )
function logPluginEvent(emblaApi, eventName) { console.log(`Autoplay just triggered ${eventName}!`) }
onMount(() => { const api = emblaApi() if (api) api.on('autoplay:stop', logPluginEvent) })
// ...}
```
Copy code snippet to clipboardCopy
```prism-code html
<script> import emblaCarouselSvelte from 'embla-carousel-svelte' import Autoplay from 'embla-carousel-autoplay'
let emblaApi let plugins = [Autoplay()]
function logPluginEvent(emblaApi, eventName) { console.log(`Autoplay just triggered ${eventName}!`) }
function onInit(event) { emblaApi = event.detail emblaApi.on('autoplay:stop', logPluginEvent) }</script>
<div class="embla" use:emblaCarouselSvelte="{{ plugins }}" onemblaInit="{onInit}"> ...</div>
```
**Note:** Starting with Svelte 5, the `on:` event handlers have been deprecated. However, `on:emblaInit` will remain for backward compatibility.
### [typescript permalink](https://www.embla-carousel.com/api/plugins/\#typescript) TypeScript
The `EmblaPluginType` is obtained directly from the **core package** `embla-carousel` and used like so:
VanillaVanillaReactReactVueVueSolidSolidSvelteSvelte
Copy code snippet to clipboardCopy
```prism-code tsx
import EmblaCarousel, { EmblaPluginType } from 'embla-carousel'import Autoplay from 'embla-carousel-autoplay'
const emblaNode = document.querySelector('.embla')const plugins: EmblaPluginType[] = [Autoplay()]const emblaApi = EmblaCarousel(emblaNode, { loop: true }, plugins)
```
Copy code snippet to clipboardCopy
```prism-code tsx
import React from 'react'import { EmblaPluginType } from 'embla-carousel'import useEmblaCarousel from 'embla-carousel-react'import Autoplay from 'embla-carousel-autoplay'
type PropType = { plugins?: EmblaPluginType[]}
export function EmblaCarousel(props) { const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true }, props.plugins)
// ...}
```
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-react` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
Copy code snippet to clipboardCopy
```prism-code html
<script setup lang="ts"> import { EmblaPluginType } from 'embla-carousel' import emblaCarouselVue from 'embla-carousel-vue' import Autoplay from 'embla-carousel-autoplay'
const plugins: EmblaPluginType[] = [Autoplay()] const [emblaRef] = emblaCarouselVue({ loop: true }, plugins)
// ...</script>
```
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-vue` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
Copy code snippet to clipboardCopy
```prism-code tsx
import { EmblaPluginType } from 'embla-carousel'import createEmblaCarousel from 'embla-carousel-solid'import Autoplay from 'embla-carousel-autoplay'
type PropType = { plugins?: EmblaPluginType[]}
export function EmblaCarousel(props) { const [emblaRef, emblaApi] = createEmblaCarousel( () => ({ loop: true }), props.plugins )
// ...}
```
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-solid` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
Copy code snippet to clipboardCopy
```prism-code html
<script> import { EmblaPluginType } from 'embla-carousel' import emblaCarouselSvelte from 'embla-carousel-svelte' import Autoplay from 'embla-carousel-autoplay'
let emblaApi let plugins: EmblaPluginType[] = [Autoplay()]</script>
<div class="embla" use:emblaCarouselSvelte="{{ plugins }}">...</div>
```
If you're using `pnpm`, you need to install `embla-carousel` as a
**devDependency** when importing types from it like demonstrated above.
This is because even though `embla-carousel-svelte` has `embla-carousel` as a
dependency, `pnpm` makes nested dependencies inaccessible by design.
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/api/plugins.mdx)
## Carousel Breakpoints Guide
[Skip to content](https://www.embla-carousel.com/guides/breakpoints/#main-content)
# Breakpoints
This guide demonstrates how to customize your carousels for different breakpoints using the [flexbox](https://www.embla-carousel.com/guides/slide-container/#using-flexbox) setup. Embla Carousel offers a convenient way to customize your carousels based on different breakpoints including changing [options](https://www.embla-carousel.com/api/options/), using plain CSS.
* * *
## [changing slide sizes permalink](https://www.embla-carousel.com/guides/breakpoints/\#changing-slide-sizes) Changing slide sizes
Embla Carousel will **automatically pick up** any **changes in slide sizes** when the **window is resized**. It's a walk in the park to change slide sizes based on your breakpoints:
Copy code snippet to clipboardCopy
```prism-code css
.embla__slide { flex: 0 0 100%; /* Default slide covers 100% of the viewport */}@media (min-width: 768px) { .embla__slide { flex: 0 0 50%; /* Breakpoint SM slide covers 50% of the viewport */ }}
```
## [changing slide gaps permalink](https://www.embla-carousel.com/guides/breakpoints/\#changing-slide-gaps) Changing slide gaps
Embla Carousel will **automatically pick up** any **changes in gap sizes** when the **window is resized**. It's very simple to change gap sizes based on your breakpoints:
Copy code snippet to clipboardCopy
```prism-code css
.embla__slide { margin-right: 10px; /* Default slide gap */}@media (min-width: 768px) { .embla__slide { margin-right: 20px; /* Breakpoint SM gap */ }}
```
## [changing options permalink](https://www.embla-carousel.com/guides/breakpoints/\#changing-options) Changing options
You can provide [options](https://www.embla-carousel.com/api/options/) that will be applied for specific breakpoints using the [breakpoint](https://www.embla-carousel.com/api/options/#breakpoints) option.
Here's an example of a carousel that's only active when the screen width is less than 768px:
Copy code snippet to clipboardCopy
```prism-code js
const options = { active: true, breakpoints: { '(min-width: 768px)': { active: false } }}
```
Because the default [active](https://www.embla-carousel.com/api/options/#active) value is `true`, we can omit it from the root level and achieve the same result as above like this:
Copy code snippet to clipboardCopy
```prism-code js
const options = { breakpoints: { '(min-width: 768px)': { active: false } }}
```
When breakpoint options **are in conflict**, the last option in the breakpoints options will be applied:
Copy code snippet to clipboardCopy
```prism-code js
const options = { loop: false, breakpoints: { '(min-width: 768px)': { loop: true }, '(min-width: 420px)': { loop: false } // This will override the (min-width: 768px) breakpoint loop option }}
```
If multiple queries match, they will be **merged**:
Copy code snippet to clipboardCopy
```prism-code js
const options = { loop: false, // --> 419px screens and down will apply { loop: false } breakpoints: { '(min-width: 420px)': { align: 'start' }, // --> 420px screens and up will apply { align: 'start', loop: false } '(min-width: 768px)': { loop: true } // --> 768px screens and up will apply { align: 'start', loop: true } }}
```
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/guides/breakpoints.md)
## Carousel Generator
[Skip to content](https://www.embla-carousel.com/examples/generator/#main-content)
# Carousel generator
Just follow the instructions and create your own customized carousel setup in no time!
* * *
## [choose framework permalink](https://www.embla-carousel.com/examples/generator/\#choose-framework) Choose framework
- Vanilla
- Vanilla + TypeScript
- React
- React + TypeScript
## [basic settings permalink](https://www.embla-carousel.com/examples/generator/\#basic-settings) Basic settings
-Horizontal
-Vertical
-Left to right
-Right to left
-Loop
-Drag free
-Accessibility (under development)
## [navigation settings permalink](https://www.embla-carousel.com/examples/generator/\#navigation-settings) Navigation settings
-Previous and next buttons
-Dot navigation
## [slide settings permalink](https://www.embla-carousel.com/examples/generator/\#slide-settings) Slide settings
Slide size (%)
Slide gaps (px)
## [alignment settings permalink](https://www.embla-carousel.com/examples/generator/\#alignment-settings) Alignment settings
Aligment settings will only make a visual **difference** for carousels with slide sizes **less than 100%**.
-Start
-Center
-End
-Clear leading and trailing space
## [plugins permalink](https://www.embla-carousel.com/examples/generator/\#plugins) Plugins
-Autoplay
-Wheel gestures (under development)
* * *
## [support permalink](https://www.embla-carousel.com/examples/generator/\#support) Support
Did this save you time? Don't say thank you! **Share** it, **star** it or **support** this project:
[Sponsor](https://github.com/sponsors/davidjerleke)
1
2
3
4
5
- Expand carousel preview
- Create Sandbox
[Edit this page on GitHub](https://github.com/davidjerleke/embla-carousel/blob/master/packages/embla-carousel-docs/src/content/pages/examples/generator.mdx)
## Carousel Examples
[Skip to content](https://www.embla-carousel.com/examples/predefined/#main-content)
# Predefined Examples
Get started instantly with pre-made CodeSandboxes or customize your carousel with the [carousel generator](https://www.embla-carousel.com/examples/generator/).
* * *
## [basic examples permalink](https://www.embla-carousel.com/examples/predefined/\#basic-examples) Basic Examples
Basic carousel setups that require minimal effort to get started with.
### [default permalink](https://www.embla-carousel.com/examples/predefined/\#default) Default
Edit Code
1
2
3
4
5
### [loop permalink](https://www.embla-carousel.com/examples/predefined/\#loop) Loop
Edit Code
1
2
3
4
5
### [right to left permalink](https://www.embla-carousel.com/examples/predefined/\#right-to-left) Right To Left
Edit Code
1
2
3
4
5
### [slides to scroll permalink](https://www.embla-carousel.com/examples/predefined/\#slides-to-scroll) Slides To Scroll
Edit Code
1
2
3
4
5
6
7
8
9
10
### [drag free permalink](https://www.embla-carousel.com/examples/predefined/\#drag-free) Drag Free
Edit Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
1 / 16
### [align permalink](https://www.embla-carousel.com/examples/predefined/\#align) Align
Edit Code
1
2
3
4
5
### [variable widths permalink](https://www.embla-carousel.com/examples/predefined/\#variable-widths) Variable Widths
Edit Code
1
2
3
4
5
6
7
8
9
1 / 9
### [y axis permalink](https://www.embla-carousel.com/examples/predefined/\#y-axis) Y-axis
Edit Code
1
2
3
4
5
### [slides per view permalink](https://www.embla-carousel.com/examples/predefined/\#slides-per-view) Slides Per View
Edit Code
1
2
3
4
5
6
### [thumbnails permalink](https://www.embla-carousel.com/examples/predefined/\#thumbnails) Thumbnails
Edit Code
1