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 include addChip(chip) to add chips and setLayout(layout) to set the display layout.

Chip List

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

Available for Google Chat apps. In developer preview 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

Method Return type Brief description
Chip List Adds a chip.
Widget Adds the event action that can be performed on the widget.
Widget Sets the unique ID assigned that's used to identify the widget to be mutated.
Chip List Sets the chip list layout.
Widget Sets the visibility of the widget.

Detailed documentation

add Chip(chip)

Adds a chip.

Parameters

Name Type Description
chip
Chip The chip to add.

Return

Chip List — This object, for chaining.


add Event Action(eventAction)

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

Parameters

Name Type Description
event Action
Event Action The Event Action to be added.

Return

Widget — The Object, for chaining.


set Id(id)

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

Parameters

Name Type Description
id
String The id of the widget, with a limit of 64 characters and in format of `[a-zA-Z0-9-]+`.

Return

Widget — This object, for chaining.


set Layout(layout)

Sets the chip list layout. If unset, it defaults to Chip List Layout.WRAPPED layout.

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

Parameters

Name Type Description
layout
Chip List Layout The chip list layout.

Return

Chip List — This object, for chaining.


set Visibility(visibility)

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

Parameters

Name Type Description
visibility
Visibility The Visibility of the widget.

Return

Widget — The Object, for chaining.

Design a Mobile Site
View Site in Mobile | Classic
Share by: