Class ChipList

  • A ChipList holds a set of Chip objects displayed in a row, wrapping to the next line or allowing horizontal scrolling.

  • It is available for Google Chat apps and in developer preview for Google Workspace add-ons.

  • Key methods includeaddChip(chip) to add chips andsetLayout(layout) to set the display layout.

ChipList

Holds a set ofChip objects that are displayed in a row, wrapping to the next line tohorizontal scrollable.

Available for Google Chat apps. In developer preview for Google Workspace add-ons.

Developer Preview: Available as part of theGoogle Workspace Developer Preview Program, which grants early access to certain features.

constchip=CardService.newChip();// Finish building the text chip...constchipList=CardService.newChipList().setLayout(CardService.ChipListLayout.WRAPPED).addChip(chip);

Methods

MethodReturn typeBrief description
addChip(chip)ChipListAdds a chip.
addEventAction(eventAction)WidgetAdds the event action that can be performed on the widget.
setId(id)WidgetSets the unique ID assigned that's used to identify the widget to be mutated.
setLayout(layout)ChipListSets the chip list layout.
setVisibility(visibility)WidgetSets the visibility of the widget.

Detailed documentation

addChip(chip)

Adds a chip.

Parameters

NameTypeDescription
chipChipThe chip to add.

Return

ChipList — This object, for chaining.


addEventAction(eventAction)

Adds the event action that can be performed on the widget.

Parameters

NameTypeDescription
eventActionEventActionTheEventAction to be added.

Return

Widget — The Object, for chaining.


setId(id)

Sets the unique ID assigned that's used to identify the widget to be mutated. Widget mutationis only supported in Add-Ons.

Parameters

NameTypeDescription
idStringThe id of the widget, with a limit of 64 characters and in format of `[a-zA-Z0-9-]+`.

Return

Widget — This object, for chaining.


setLayout(layout)

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

constchip=CardService.newChip();// Finish building the text chip...constchipList=CardService.newChipList().setLayout(CardService.ChipListLayout.HORIZONTAL_SCROLLABLE).addChip(chip);

Parameters

NameTypeDescription
layoutChipListLayoutThe chip list layout.

Return

ChipList — This object, for chaining.


setVisibility(visibility)

Sets the visibility of the widget. The default value is `VISIBLE`.

Parameters

NameTypeDescription
visibilityVisibilityTheVisibility of the widget.

Return

Widget — The Object, for chaining.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-03 UTC.