Reference documentation and code samples for the Google Apps Chat V1 Client class Chip.
A text, icon, or text and icon chip that users can click.
Google Workspace add-ons and Chat apps:
Generated from protobuf message google.apps.card.v1.Chip
Namespace
Google \ Apps \ Card \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ icon |
Icon
The icon image. If both |
↳ label |
string
The text displayed inside the chip. |
↳ on_click |
OnClick
Optional. The action to perform when a user clicks the chip, such as opening a hyperlink or running a custom function. |
↳ enabled |
bool
Whether the chip is in an active state and responds to user actions. Defaults to |
↳ disabled |
bool
Whether the chip is in an inactive state and ignores user actions. Defaults to |
↳ alt_text |
string
The alternative text that's used for accessibility. Set descriptive text that lets users know what the chip does. For example, if a chip opens a hyperlink, write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat". |
getIcon
The icon image. If both icon and text are set, then the icon appears
before the text.
| Returns | |
|---|---|
| Type | Description |
Icon|null |
|
hasIcon
clearIcon
setIcon
The icon image. If both icon and text are set, then the icon appears
before the text.
| Parameter | |
|---|---|
| Name | Description |
var |
Icon
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getLabel
The text displayed inside the chip.
| Returns | |
|---|---|
| Type | Description |
string |
|
setLabel
The text displayed inside the chip.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getOnClick
Optional. The action to perform when a user clicks the chip, such as opening a hyperlink or running a custom function.
| Returns | |
|---|---|
| Type | Description |
OnClick|null |
|
hasOnClick
clearOnClick
setOnClick
Optional. The action to perform when a user clicks the chip, such as opening a hyperlink or running a custom function.
| Parameter | |
|---|---|
| Name | Description |
var |
OnClick
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getEnabled
Whether the chip is in an active state and responds to user actions.
Defaults to true.
Deprecated. Use disabled instead.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setEnabled
Whether the chip is in an active state and responds to user actions.
Defaults to true.
Deprecated. Use disabled instead.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDisabled
Whether the chip is in an inactive state and ignores user actions.
Defaults to false.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setDisabled
Whether the chip is in an inactive state and ignores user actions.
Defaults to false.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getAltText
The alternative text that's used for accessibility.
Set descriptive text that lets users know what the chip does. For example, if a chip opens a hyperlink, write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
| Returns | |
|---|---|
| Type | Description |
string |
|
setAltText
The alternative text that's used for accessibility.
Set descriptive text that lets users know what the chip does. For example, if a chip opens a hyperlink, write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|