Table of Contents

ComboStrap - Carrousel Layout

About

A carrousel is a layout component where the user can cycle through elements in a horizontal way.

To cycle through the elements, you can use:

Because a carrousel is also known as a slideshow, the elements of a carrousel are generally called slides.

Example

This example shows you a carrousel of image known also as a image gallery.

<carrousel>
{{ :woman-yoga-sunset.jpg?0x600 |}}
{{ :page_speed_performance.png?0x600 |}}
{{ :undraw_content_creator.svg?0x600 |}}
</carrousel>
Woman Yoga Sunset Page Speed Performance Undraw Content Creator

Carrousel dynamically created with the iterator

With the template iterator, you can create dynamically the children that you want to show.

Example with all pages that are in the layout path.

<iterator>
    <data>select where path like "%layout%" order by title asc limit 10</data>

    <heading h4 align="text-center" spacing="mb-3"> The pages talking about layout in ComboStrap </heading>
    <carrousel element-width="250px">
        <fragment>
            <card clickable>
            <page-image path="$path" ratio="16:9"/>
            == $title ==
            <itext color="muted">${date_modified | format("eeee dd-MM KK:mm")}</itext>

            ${description" | head(200,"...")} [[$path| ]]
            </card>
        </fragment>
    </carrousel>
</iterator>
The pages talking about layout in ComboStrap
Undraw Website Builder Re Ii6e
A bar - A horizontal region

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
ComboStrap UI - Box

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
ComboStrap UI - HR (Horizontal Rule)

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
ComboStrap UI - Jumbotron

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
ComboStrap UI - Masonry

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
Component Layouts

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
Grid Layout: How to create a responsive space distribution on the horizontal axis

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
How to create a accordion layout ?

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
How to create a carrousel layout

Wednesday 05-02 10:42

| head(200,

Undraw Website Builder Re Ii6e
Layout components of Combostrap

Wednesday 05-02 10:42

| head(200,



Minimum Elements Count

If the number of elements is not enough to feel the screen, the default behavior of the carrousel is to repeat them.

The elements-min attribute permits to disable this feature and to replace the carrousel by a grid if the minimum element count is not met. By default, the value is 3.

This feature is most used with an iterator where the number of element is not known in advance but for the purpose if this demonstration we are using 2 fix cards.

<carrousel element-width="250px" elements-min="3">
<card>
{{:logo.svg?ratio=21:9|}}
=== First Card ===
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor 
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud 
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
</card>
<card>
{{:logo.svg?ratio=21:9|}}
=== Second Card ===
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor 
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud 
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
</card>
</carrousel>
First Card

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Second Card

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Syntax

<carrousel 
   element-width="..." 
   elements-min="..."
   control="all|none"
>
</carrousel>

where:



Implicit difference between the gallery mode and other carrousels

A gallery for Combostrap is a carrousel that shows only one element at a time. This is the default mode (ie when the element-width attribute is unset).

Support

Lazy Loading

Lazy loading works on modern browser where the loading attribute is supported.