Icon

An icon displayed in a widget on a card. For an example in Google Chat apps, see Add an icon.

Supports built-in and custom icons.

Available for Google Chat apps and Google Workspace add-ons.

JSON representation
{
  "altText": string,
  "imageType": enum (ImageType),

  "knownIcon": string,
  "iconUrl": string,
  "materialIcon": {
    object (MaterialIcon)
  }
}
Fields
altText

string

Optional. A description of the icon used for accessibility. If unspecified, the default value Button is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, A user's account portrait, or Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat.

If the icon is set in a Button, the altText appears as helper text when the user hovers over the button. However, if the button also sets text, the icon's altText is ignored.

imageType

enum (ImageType)

The crop style applied to the image. In some cases, applying a CIRCLE crop causes the image to be drawn larger than a built-in icon.

The icon displayed in the widget on the card. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
knownIcon

string

Display one of the built-in icons provided by Google Workspace.

For example, to display an airplane icon, specify AIRPLANE. For a bus, specify BUS.

For a full list of supported icons, see built-in icons.

iconUrl

string

Display a custom icon hosted at an HTTPS URL.

For example:

"iconUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png"

Supported file types include .png and .jpg.

materialIcon

object (MaterialIcon)

Display one of the Google Material Icons.

For example, to display a checkbox icon, use

"materialIcon": {
  "name": "check_box"
}

Available for Google Chat apps and unavailable for Google Workspace add-ons.

End of mutually exclusive fields.