A customizable collapse and expand control.
Available for Google Chat apps. In developer preview for Google Workspace Add-ons.
const collapseButton = CardService.newTextButton() .setTextButtonStyle(CardService.TextButtonStyle.BORDERLESS) .setText('Collapse'); const expandButton = CardService.newImageButton() .setImageButtonStyle(CardService.ImageButtonStyle.FILLED); const collapseControl = CardService.newCollapseControl() .setHorizontalAlign(CardService.HorizontalAlignment.END) .setExpandButton(expandButton) .setCollapseButton(collapseButton);
Methods
Method | Return type | Brief description |
---|---|---|
set | Collapse | Sets the Button that is displayed for "show less" button. |
set | Collapse | Sets the Button that is displayed for "show more" button. |
set | Collapse | Sets the Horizontal of the Collapse . |
Detailed documentation
setCollapseButton(button)
Sets the Button
that is displayed for "show less" button. Optional.
Must be set together with collapse button.
const collapseButton = CardService.newTextButton().setText('Collapse'); const collapseControl = CardService.newCollapseControl() .setCollapseButton(collapseButton);
Parameters
Name | Type | Description |
---|---|---|
button | Button | The collapse button to set. |
Return
Collapse
— This object, for chaining.
setExpandButton(button)
Sets the Button
that is displayed for "show more" button. Optional.
Must be set together with collapse button.
const expandButton = CardService.newTextButton().setText('Expand'); const collapseControl = CardService.newCollapseControl() .setExpandButton(expandButton);
Parameters
Name | Type | Description |
---|---|---|
button | Button | The expand button to set. |
Return
Collapse
— This object, for chaining.
setHorizontalAlign(horizontalAlignment)
Sets the Horizontal
of the Collapse
. Optional. *
const collapseControl = CardService.newCollapseControl().setHorizontalAlign( CardService.HorizontalAlignment.START, );
Parameters
Name | Type | Description |
---|---|---|
horizontal | Horizontal | The horizontal alignment of the CollapseControl widget. |
Return
Collapse
— This object, for chaining.