Lenra Docs
Register on Lenra
  • Home
  • Getting started
    Open/Close
  • Guides
    Open/Close
  • Features
    Open/Close
  • References
    Open/Close
  • Contribute

    Carousel

    This is the carousel component.

    It takes children as parameters. options can also be added but are optional.

    Examples

    Simple carousel

    {
        "type": "carousel",
        "children": [
            {
                "type": "text",
                "value": "page 1",
            },
            {
                "type": "text",
                "value": "page 2",
            }
        ]
    }
    

    Vertical scroll Carousel with enlarged center element

    {
        "type": "carousel",
        "options": {
            "aspectRatio": 2.0,
            "enlargeCenterPage": true,
            "scrollDirection": "vertical",
        },
        "children": [
            {
                "type": "container",
                "padding": {"top": 8, "left": 8, "bottom": 8, "right": 8},
                "child":  {"type": "text", "value": "This is element number 1"}
            },
            {
                "type": "container",
                "padding": {"top": 8, "left": 8, "bottom": 8, "right": 8},
                "child":  {"type": "text", "value": "This is element number 2"}
            },
        ]
    }
    

    Properties

    AttributeDescriptionType
    _typeThe identifier of the component
    • carousel
    childrenThe childrenarray
    optionsElement of type CarouselOptionsCarouselOptions