Class CarouselCard
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
KaruzelaKarta
Karta, która może być wyświetlana jako element karuzeli.
Dostępne w przypadku dodatków do Google Workspace i aplikacji Google Chat.
const carouselCard = CardService.newCarouselCard()
.addWidget(
CardService.newTextParagraph().setText('a text paragraph in the carousel card'))
.addFooterWidget(
CardService.newTextParagraph().setText('a text paragraph in the carousel card footer'));
Szczegółowa dokumentacja
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eCarouselCard is a type of card designed for use in carousels within Google Workspace add-ons and Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddFooterWidget(widget)\u003c/code\u003e method lets you add a widget to the footer area of the CarouselCard, with widgets displayed in the order they are added.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddWidget(widget)\u003c/code\u003e method is used to add a widget to the main content area of the CarouselCard, and widgets are shown in the order added.\u003c/p\u003e\n"],["\u003cp\u003eCarouselCard is accessible as part of the Google Workspace Developer Preview Program, allowing developers to get early access to features.\u003c/p\u003e\n"]]],[],null,["# Class CarouselCard\n\nCarouselCard\n\nA card that can be displayed as a carousel item.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\n```javascript\nconst carouselCard = CardService.newCarouselCard()\n .addWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card'))\n .addFooterWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card footer'));\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| [addFooterWidget(widget)](#addFooterWidget(Widget)) | [CarouselCard](#) | Adds the given widget to the footer of this carousel card. |\n| [addWidget(widget)](#addWidget(Widget)) | [CarouselCard](#) | Adds the given widget to this carousel card. |\n\nDetailed documentation\n----------------------\n\n### `add``Footer``Widget(widget)`\n\nAdds the given widget to the footer of this carousel card. Widgets are shown in the order they\nwere added.\n\n```javascript\nconst carouselCard = CardService.newCarouselCard()\n .addFooterWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card footer'));\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|-----------------------------------------------------|\n| `widget` | [Widget](/apps-script/reference/card-service/widget) | A widget to add to the footer of the carousel card. |\n\n#### Return\n\n\n[CarouselCard](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `add``Widget(widget)`\n\nAdds the given widget to this carousel card. Widgets are shown in the order they were added.\n\n```javascript\nconst carouselCard = CardService.newCarouselCard()\n .addWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card'));\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|---------------------------------------|\n| `widget` | [Widget](/apps-script/reference/card-service/widget) | A widget to add to the carousel card. |\n\n#### Return\n\n\n[CarouselCard](#) --- This object, for chaining."]]