Class Carousel

Carousel

Carousel, also known as slider, rotates and displays a list of widgets in a slideshow format, with buttons navigating to the previous or next widget.

Available for Google Workspace Add-ons and Google Chat apps.

const carousel =
    CardService.newCarousel()
        .addCarouselCard(CardService.newCarouselCard().addWidget(
            CardService.newTextParagraph().setText('The first text paragraph in carousel')))
        .addCarouselCard(CardService.newCarouselCard().addWidget(
            CardService.newTextParagraph().setText('The second text paragraph in carousel')))
        .addCarouselCard(CardService.newCarouselCard().addWidget(
            CardService.newTextParagraph().setText('The third text paragraph in carousel')))

Methods

MethodReturn typeBrief description
addCarouselCard(card)CarouselAdds a carousel card.

Detailed documentation

addCarouselCard(card)

Adds a carousel card.

const carousel =
    CardService.newCarousel()
        .addCarouselCard(CardService.newCarouselCard().addWidget(
            CardService.newTextParagraph().setText('The first text paragraph in carousel')));

Parameters

NameTypeDescription
cardCarouselCardThe carousel card to add.

Return

Carousel — This object, for chaining.