Class Carousel
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Karussell
Ein Karussell, auch als Schieberegler bezeichnet, dreht sich und zeigt eine Liste von Widgets in einem Diashow-Format an. Mit den Schaltflächen können Sie zum vorherigen oder nächsten Widget wechseln.
Verfügbar für Google Workspace-Add-ons und 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')))
Detaillierte Dokumentation
addCarouselCard(card)
Fügen Sie eine Karussellkarte hinzu.
const carousel =
CardService.newCarousel()
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The first text paragraph in carousel')));
Parameter
Name | Typ | Beschreibung |
card | CarouselCard | Die hinzuzufügende Karussellkarte. |
Rückflug
Carousel
– dieses Objekt, zur Verkettung
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["\u003cp\u003eCarousel, also known as a slider, displays widgets in a rotating slideshow format with navigation buttons.\u003c/p\u003e\n"],["\u003cp\u003eCarousels are available for use in Google Workspace add-ons and Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddCarouselCard(card)\u003c/code\u003e method is used to add a carousel card to the carousel, and it returns the Carousel object for chaining.\u003c/p\u003e\n"],["\u003cp\u003eCarousels are currently part of the Google Workspace Developer Preview Program, providing early access to this feature.\u003c/p\u003e\n"]]],["Carousel, or slider, displays widgets in a slideshow format, navigable via buttons. It's available for Google Workspace add-ons and Google Chat apps. Developers use `CardService.newCarousel()` to create it. `addCarouselCard(card)` method adds individual cards, such as text paragraphs, to the carousel. Each card can be created using `CardService.newCarouselCard()`. This method returns the Carousel object, allowing for chaining of card additions. This is available in the Google Workspace Developer Preview Program.\n"],null,["# Class Carousel\n\nCarousel\n\nCarousel, also known as slider, rotates and displays a list of widgets in a slideshow format,\nwith buttons navigating to the previous or next widget.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\n```javascript\nconst carousel =\n CardService.newCarousel()\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The first text paragraph in carousel')))\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The second text paragraph in carousel')))\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The third text paragraph in carousel')))\n```\n\n\n| **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.\n\n\u003cbr /\u003e\n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------|---------------|-----------------------|\n| [addCarouselCard(card)](#addCarouselCard(CarouselCard)) | [Carousel](#) | Adds a carousel card. |\n\nDetailed documentation\n----------------------\n\n### `add``Carousel``Card(card)`\n\nAdds a carousel card.\n\n```javascript\nconst carousel =\n CardService.newCarousel()\n .addCarouselCard(CardService.newCarouselCard().addWidget(\n CardService.newTextParagraph().setText('The first text paragraph in carousel')));\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|-------------------------------------------------------------------|---------------------------|\n| `card` | [CarouselCard](/apps-script/reference/card-service/carousel-card) | The carousel card to add. |\n\n#### Return\n\n\n[Carousel](#) --- This object, for chaining."]]