Closed NoxQ closed 8 months ago
Hi, @NoxQ!
Obviously, the problem does not belong to the library. To avoid the flicks you should know the height of the first slide(s).
For example, the height of the first slide is 200px
, then you should set minHeight: 200
for the slide element using CSS or inline styles. If the loading latency is high, use a loading skeleton to close the loading space.
Please see the examples.
Yes you're right that it's not an inherent problem with the library. I was thinking something like a "placeholder" like the Image component in NextJS has where it would immediately display something before fully loading.
The problem with your example is that the size of the first slide might be dynamic so hardcoding it wouldn't work.
Is there any way I can preload the carousel's height or similar in order to avoid layout shift?
Even on localhost it takes about 0.5s for the carousel to show up which causes a serious layout shift.
This is an issue as the carousel is on the landing page.