question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple Items Per Slide API

See original GitHub issue

Feature request is related to

  • The Vanilla JavaScript version
  • The React version
  • The Embla Carousel core (all versions)
  • Documentation website
  • Other

Is your feature request related to an issue?

  • the ability to have multiple items per cell was mention in #120 (ignoring the windowing / virtual scrolling aspects of that discussion)

Describe the solution you’d like

I think a lot of people would find it convenient to have the option to group multiple items per slide. With the current API it is possible to have multiple items per slide like this:

.embla { overflow: hidden;}
.embla__container { display: flex;}
.embla__slide {
  position: relative;
  flex: 0 0 25%;
}

however, you are often left with huge space gaps in between the items. From a code standpoint, I get why there’s the gap, its due to the flex-basis value.

https://user-images.githubusercontent.com/6743796/113498552-c6836c00-94c2-11eb-9bea-5f25e5fdb866.mp4

I believe that the majority of people who want multiple items per slides probably don’t want those gaps and instead what they are looking for is the concept of multiple items per slide like this:

https://user-images.githubusercontent.com/6743796/113498663-d8194380-94c3-11eb-918d-ef4d39267209.mp4

Being able to pass an option to decide how many items per slide to show. (2,3,4, N…) example

Screen Shot 2021-04-03 at 9 35 33 PM Screen Shot 2021-04-03 at 9 35 50 PM Screen Shot 2021-04-03 at 9 34 48 PM

Codesandbox

I have a simple demo using Embla of the multiple items per slide concept ^^

https://user-images.githubusercontent.com/6743796/113498269-44924380-94c0-11eb-80a8-117f63078d44.mp4

A more robust solution would be something similar to Flickity’s groupCells option for its carousel and tighter integration with the events and methods Embla uses under the hood

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cliffordfajardocommented, Apr 5, 2021

Yeah I just did this morning 🎉 I was able to achieve what I needed by digging more into the API

2reactions
davidjerlekecommented, Apr 5, 2021

Hi Clifford (@cliffordfajardo),

No worries. I’ll consider creating a guide about grouping slides when possible. Maybe that will make it more clear for users looking for this feature.

Have you had the chance to try this out yet?

Best, David

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple Items Per Slide API · Issue #172 · davidjerleke/embla ...
This tells each slide to be 1/4 of the carousel viewport. You should either make the content inside the slides stretch so it...
Read more >
multiple items per slide in bootstrap carousel - CodePen
Here's a way to iterate through multiple items in one slide in bootstrap 3.3.x But tbh, ... <h1>Use Bootstrap 3's carousel to show...
Read more >
multiple items per slide in bootstrap carousel angularjs
I am new in angular js and i am trying to write a simple Carousel example with multiple items but right now i...
Read more >
Multiple items per slide [#1360966] | Drupal.org
I assume he's referring to a feature in Views Slideshow Cycle where you can group multiple result sets together on one slide.
Read more >
Bootstrap Multi item carousel - examples & tutorial
An advanced slideshow component for cycling through images with a selectable number of active items. Responsive Multi item carousel built with the latest ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found