Class Carousel

  • Carousel, also known as a slider, displays widgets in a rotating slideshow format with navigation buttons.

  • Carousels are available for use in Google Workspace add-ons and Google Chat apps.

  • The addCarouselCard(card) method is used to add a carousel card to the carousel, and it returns the Carousel object for chaining.

  • Carousels are currently part of the Google Workspace Developer Preview Program, providing early access to this feature.

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.