The Icon
widget represents either a
built-in
icon or
custom
icon. You can use Icon
in
card messages
and
dialogs
in the following ways:
- Display a standalone icon.
- Display an icon in front of related text, as part of a
DecoratedText
widget. - Display an icon as an interactive button, as part of a
ButtonList
widget.
The following is a card consisting of an Icon
component:
Available built-in icons for the Icon
widget
To use a built-in icon, you use the knownIcon
field:
{ . . . "knownIcon": "TRAIN", . . . }
The following table lists the built-in icons that are available for card messages:
AIRPLANE | BOOKMARK | ||
BUS | CAR | ||
CLOCK | CONFIRMATION_NUMBER_ICON | ||
DESCRIPTION | DOLLAR | ||
EVENT_SEAT | |||
FLIGHT_ARRIVAL | FLIGHT_DEPARTURE | ||
HOTEL | HOTEL_ROOM_TYPE | ||
INVITE | MAP_PIN | ||
MEMBERSHIP | MULTIPLE_PEOPLE | ||
PERSON | PHONE | ||
RESTAURANT_ICON | SHOPPING_CART | ||
STAR | STORE | ||
TICKET | TRAIN | ||
VIDEO_CAMERA | VIDEO_PLAY |
JSON representation and fields
JSON representation |
---|
{ "altText": string, "imageType": enum ( |
Fields | |
---|---|
altText
|
Optional. A description of the icon used for accessibility. If unspecified, the default value
If the icon is set in a
|
imageType
|
The crop style applied to the image. In some cases, applying a
|
Union field
icons . The icon displayed in the widget on the card.
icons
can be only one of the following:
|
|
knownIcon
|
Display one of the built-in icons provided by Google Workspace.
For example, to display an airplane icon, specify
For a full list of supported icons, see built-in icons. |
iconUrl
|
Display a custom icon hosted at an HTTPS URL. For example:
Supported file types include
|
ImageType
The shape used to crop the image.
Enums | |
---|---|
SQUARE
|
Default value. Applies a square mask to the image. For example, a 4x3 image becomes 3x3. |
CIRCLE
|
Applies a circular mask to the image. For example, a 4x3 image becomes a circle with a diameter of 3. |
Troubleshoot
When a Google Chat app or card returns an error, the Chat interface surfaces a message saying "Something went wrong." or "Unable to process your request." Sometimes the Chat UI doesn't display any error message, but the Chat app or card produces an unexpected result; for example, a card message might not appear.
Although an error message might not display in the Chat UI, descriptive error messages and log data are available to help you fix errors when error logging for Chat apps is turned on. For help viewing, debugging, and fixing errors, see Troubleshoot and fix Google Chat errors.