Class ChipList

ChipList

Holds a set of Chip objects that are displayed in a row, wrapping to the next line to horizontal scrollable.

Only available for Google Chat apps. Not available for Google Workspace Add-ons.

const chip = CardService.newChip();
// Finish building the text chip...

const chipList = CardService.newChipList()
                     .setLayout(CardService.ChipListLayout.WRAPPED)
                     .addChip(chip);

Methods

MethodReturn typeBrief description
addChip(chip)ChipListAdds a chip.
setLayout(layout)ChipListSets the chip list layout.

Detailed documentation

addChip(chip)

Adds a chip.

Parameters

NameTypeDescription
chipChipThe chip to add.

Return

ChipList — This object, for chaining.


setLayout(layout)

Sets the chip list layout. If unset, it defaults to ChipListLayout.WRAPPED layout.

const chip = CardService.newChip();
// Finish building the text chip...

const chipList =
    CardService.newChipList()
        .setLayout(CardService.ChipListLayout.HORIZONTAL_SCROLLABLE)
        .addChip(chip);

Parameters

NameTypeDescription
layoutChipListLayoutThe chip list layout.

Return

ChipList — This object, for chaining.