Index
Action
(message)Action.ActionParameter
(message)Action.Interaction
(enum)Action.LoadIndicator
(enum)BorderStyle
(message)BorderStyle.BorderType
(enum)Button
(message)Button.Type
(enum)ButtonList
(message)Card
(message)Card.CardAction
(message)Card.CardFixedFooter
(message)Card.CardHeader
(message)Card.DisplayStyle
(enum)Card.DividerStyle
(enum)Card.NestedWidget
(message)Card.Section
(message)Carousel
(message)Carousel.CarouselCard
(message)Chip
(message)ChipList
(message)ChipList.Layout
(enum)CollapseControl
(message)Columns
(message)Columns.Column
(message)Columns.Column.HorizontalSizeStyle
(enum)Columns.Column.VerticalAlignment
(enum)Columns.Column.Widgets
(message)DateTimePicker
(message)DateTimePicker.DateTimePickerType
(enum)DecoratedText
(message)DecoratedText.SwitchControl
(message)DecoratedText.SwitchControl.ControlType
(enum)Divider
(message)Grid
(message)Grid.GridItem
(message)Grid.GridItem.GridItemLayout
(enum)Icon
(message)Image
(message)ImageComponent
(message)ImageCropStyle
(message)ImageCropStyle.ImageCropType
(enum)MaterialIcon
(message)OnClick
(message)OpenLink
(message)OpenLink.OnClose
(enum)OpenLink.OpenAs
(enum)OverflowMenu
(message)OverflowMenu.OverflowMenuItem
(message)SelectionInput
(message)SelectionInput.PlatformDataSource
(message)SelectionInput.PlatformDataSource.CommonDataSource
(enum)SelectionInput.SelectionItem
(message)SelectionInput.SelectionType
(enum)Suggestions
(message)Suggestions.SuggestionItem
(message)TextInput
(message)TextInput.Type
(enum)TextParagraph
(message)TextParagraph.TextSyntax
(enum)Validation
(message)Validation.InputType
(enum)Widget
(message)Widget.HorizontalAlignment
(enum)Widget.ImageType
(enum)Widget.VerticalAlignment
(enum)
Action
An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
function |
A custom function to invoke when the containing element is clicked or otherwise activated. For example usage, see Read form data. |
parameters[] |
List of action parameters. |
load_indicator |
Specifies the loading indicator that the action displays while making the call to the action. |
persist_values |
Indicates whether form values persist after the action. The default value is If If |
interaction |
Optional. Required when opening a dialog. What to do in response to an interaction with a user, such as a user clicking a button in a card message. If unspecified, the app responds by executing an By specifying an
|
required_widgets[] |
Optional. Fill this list with the names of widgets that this Action needs for a valid submission. If the widgets listed here don't have a value when this Action is invoked, the form submission is aborted.
|
all_widgets_are_required |
Optional. If this is true, then all widgets are considered required by this action.
|
ActionParameter
List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze one day, or snooze next week. You might use action method = snooze()
, passing the snooze type and snooze time in the list of string parameters.
To learn more, see CommonEventObject
.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
key |
The name of the parameter for the action script. |
value |
The value of the parameter. |
Interaction
Optional. Required when opening a dialog.
What to do in response to an interaction with a user, such as a user clicking a button in a card message.
If unspecified, the app responds by executing an action
—like opening a link or running a function—as normal.
By specifying an interaction
, the app can respond in special interactive ways. For example, by setting interaction
to OPEN_DIALOG
, the app can open a dialog.
When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client.
Available for Google Chat apps and unavailable for Google Workspace add-ons.
Enums | |
---|---|
INTERACTION_UNSPECIFIED |
Default value. The action executes as normal. |
OPEN_DIALOG |
Opens a dialog, a windowed, card-based interface that Chat apps use to interact with users. Only supported by Chat apps in response to button-clicks on card messages. If specified for an add-on, the entire card is stripped and nothing is shown in the client.
|
LoadIndicator
Specifies the loading indicator that the action displays while making the call to the action.
Available for Google Chat apps and Google Workspace add-ons.
Enums | |
---|---|
SPINNER |
Displays a spinner to indicate that content is loading. |
NONE |
Nothing is displayed. |
BorderStyle
The style options for the border of a card or widget, including the border type and color.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
type |
The border type. |
stroke_color |
The colors to use when the type is To set the stroke color, specify a value for the For example, the following sets the color to red at its maximum intensity:
The |
corner_radius |
The corner radius for the border. |
BorderType
Represents the border types applied to widgets.
Available for Google Chat apps and Google Workspace add-ons.
Enums | |
---|---|
BORDER_TYPE_UNSPECIFIED |
Don't use. Unspecified. |
NO_BORDER |
No border. |
STROKE |
Default value. Outline. |
Button
A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see Add a button.
To make an image a clickable button, specify an
(not an Image
) and set an ImageComponent
onClick
action.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
text |
The text displayed inside the button. |
icon |
An icon displayed inside the button. If both |
color |
Optional. The color of the button. If set, the button To set the button color, specify a value for the For example, the following sets the color to red at its maximum intensity:
The |
on_click |
Required. The action to perform when a user clicks the button, such as opening a hyperlink or running a custom function. |
disabled |
If |
alt_text |
The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat". |
type |
Optional. The type of a button. If unset, button type defaults to |
Type
Optional. The type of a button. If color
field is set, the type
is forced to FILLED
.
Available for Google Chat apps and unavailable for Google Workspace add-ons.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Don't use. Unspecified. |
OUTLINED |
Outlined buttons are medium-emphasis buttons. They usually contain actions that are important, but aren’t the primary action in a Chat app or an add-on. |
FILLED |
A filled button has a container with a solid color. It has the most visual impact and is recommended for the important and primary action in a Chat app or an add-on. |
FILLED_TONAL |
A filled tonal button is an alternative middle ground between filled and outlined buttons. They’re useful in contexts where a lower-priority button requires slightly more emphasis than an outline button would give. |
BORDERLESS |
A button does not have an invisible container in its default state. It is often used for the lowest priority actions, especially when presenting multiple options. |
ButtonList
A list of buttons layed out horizontally. For an example in Google Chat apps, see Add a button.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
buttons[] |
An array of buttons. |
Card
A card interface displayed in a Google Chat message or Google Workspace add-on.
Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step.
Design and preview cards with the Card Builder.
Open the Card BuilderTo learn how to build cards, see the following documentation:
- For Google Chat apps, see Design the components of a card or dialog.
- For Google Workspace add-ons, see Card-based interfaces.
Note: You can add up to 100 widgets per card. Any widgets beyond this limit are ignored. This limit applies to both card messages and dialogs in Google Chat apps, and to cards in Google Workspace add-ons.
Example: Card message for a Google Chat app
To create the sample card message in Google Chat, use the following JSON:
{
"cardsV2": [
{
"cardId": "unique-card-id",
"card": {
"header": {
"title": "Sasha",
"subtitle": "Software Engineer",
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"imageType": "CIRCLE",
"imageAltText": "Avatar for Sasha"
},
"sections": [
{
"header": "Contact Info",
"collapsible": true,
"uncollapsibleWidgetsCount": 1,
"widgets": [
{
"decoratedText": {
"startIcon": {
"knownIcon": "EMAIL"
},
"text": "[email protected]"
}
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PERSON"
},
"text": "<font color=\"#80e27e\">Online</font>"
}
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PHONE"
},
"text": "+1 (555) 555-1234"
}
},
{
"buttonList": {
"buttons": [
{
"text": "Share",
"onClick": {
"openLink": {
"url": "https://example.com/share"
}
}
},
{
"text": "Edit",
"onClick": {
"action": {
"function": "goToView",
"parameters": [
{
"key": "viewType",
"value": "EDIT"
}
]
}
}
}
]
}
}
]
}
]
}
}
]
}
Fields | |
---|---|
header |
The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card. |
sections[] |
Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Define a section of a card. |
section_divider_style |
The divider style between the header, sections and footer. |
card_actions[] |
The card's actions. Actions are added to the card's toolbar menu.
For example, the following JSON constructs a card action menu with
|
name |
Name of the card. Used as a card identifier in card navigation.
|
fixed_footer |
The fixed footer shown at the bottom of this card. Setting
|
display_style |
In Google Workspace add-ons, sets the display properties of the
|
peek_card_header |
When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.
|
CardAction
A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser.
Available for Google Workspace add-ons and unavailable for Google Chat apps.
Fields | |
---|---|
action_label |
The label that displays as the action menu item. |
on_click |
The |
CardHeader
Represents a card header. For an example in Google Chat apps, see Add a header.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
title |
Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines. |
subtitle |
The subtitle of the card header. If specified, appears on its own line below the |
image_type |
The shape used to crop the image.
|
image_url |
The HTTPS URL of the image in the card header. |
image_alt_text |
The alternative text of this image that's used for accessibility. |
DisplayStyle
In Google Workspace add-ons, determines how a card is displayed.
Available for Google Workspace add-ons and unavailable for Google Chat apps.
Enums | |
---|---|
DISPLAY_STYLE_UNSPECIFIED |
Don't use. Unspecified. |
PEEK |
The header of the card appears at the bottom of the sidebar, partially covering the current top card of the stack. Clicking the header pops the card into the card stack. If the card has no header, a generated header is used instead. |
REPLACE |
Default value. The card is shown by replacing the view of the top card in the card stack. |
DividerStyle
The divider style of a card. Currently only used for dividers betweens card sections.
Available for Google Chat apps and Google Workspace add-ons.
Enums | |
---|---|
DIVIDER_STYLE_UNSPECIFIED |
Don't use. Unspecified. |
SOLID_DIVIDER |
Default option. Render a solid divider. |
NO_DIVIDER |
If set, no divider is rendered. This style completely removes the divider from the layout. The result is equivalent to not adding a divider at all. |
NestedWidget
A list of widgets that can be displayed in a containing layout, such as a CarouselCard
. Available for Google Chat apps and unavailable for Google Workspace add-ons.
Fields | |
---|---|
Union field
|
|
text_paragraph |
A text paragraph widget. |
button_list |
A button list widget. |
image |
An image widget. |
Section
A section contains a collection of widgets that are rendered vertically in the order that they're specified.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
header |
Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons. |
widgets[] |
All the widgets in the section. Must contain at least one widget. |
collapsible |
Indicates whether this section is collapsible. Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking Show more. Users can hide the widgets again by clicking Show less. To determine which widgets are hidden, specify |
uncollapsible_widgets_count |
The number of uncollapsible widgets which remain visible even when a section is collapsed. For example, when a section contains five widgets and the |
collapse_control |
Optional. Define the expand and collapse button of the section. This button will be shown only if the section is collapsible. If this field isn't set, the default button is used. |
Carousel
A carousel, also known as a slider, rotates and displays a list of widgets in a slideshow format, with buttons navigating to the previous or next widget.
For example, this is a JSON representation of a carousel that contains three text paragraph widgets.
{
"carouselCards": [
{
"widgets": [
{
"textParagraph": {
"text": "First text paragraph in carousel",
}
}
]
},
{
"widgets": [
{
"textParagraph": {
"text": "Second text paragraph in carousel",
}
}
]
},
{
"widgets": [
{
"textParagraph": {
"text": "Third text paragraph in carousel",
}
}
]
}
]
}
Available for Google Chat apps and unavailable for Google Workspace add-ons.
Fields | |
---|---|
carousel_cards[] |
A list of cards included in the carousel. |
CarouselCard
A card that can be displayed as a carousel item. Available for Google Chat apps and unavailable for Google Workspace add-ons.
Fields | |
---|---|
widgets[] |
A list of widgets displayed in the carousel card. The widgets are displayed in the order that they are specified. |
footer_widgets[] |
A list of widgets displayed at the bottom of the carousel card. The widgets are displayed in the order that they are specified. |
Chip
A text, icon, or text and icon chip that users can click.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
icon |
The icon image. If both |
label |
The text displayed inside the chip. |
on_click |
Optional. The action to perform when a user clicks the chip, such as opening a hyperlink or running a custom function. |
enabled |
Whether the chip is in an active state and responds to user actions. Defaults to |
disabled |
Whether the chip is in an inactive state and ignores user actions. Defaults to |
alt_text |
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". |
ChipList
A list of chips layed out horizontally, which can either scroll horizontally or wrap to the next line.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
layout |
Specified chip list layout. |
chips[] |
An array of chips. |
Layout
The chip list layout.
Enums | |
---|---|
LAYOUT_UNSPECIFIED |
Don't use. Unspecified. |
WRAPPED |
Default value. The chip list wraps to the next line if there isn't enough horizontal space. |
HORIZONTAL_SCROLLABLE |
The chips scroll horizontally if they don't fit in the available space. |
CollapseControl
Represent an expand and collapse control.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
horizontal_alignment |
The horizontal alignment of the expand and collapse button. |
expand_button |
Optional. Define a customizable button to expand the section. Both expand_button and collapse_button field must be set. Only one field set will not take into effect. If this field isn't set, the default button is used. |
collapse_button |
Optional. Define a customizable button to collapse the section. Both expand_button and collapse_button field must be set. Only one field set will not take into effect. If this field isn't set, the default button is used. |
Columns
The Columns
widget displays up to 2 columns in a card or dialog. You can add widgets to each column; the widgets appear in the order that they are specified. For an example in Google Chat apps, see Display cards and dialogs in columns.
The height of each column is determined by the taller column. For example, if the first column is taller than the second column, both columns have the height of the first column. Because each column can contain a different number of widgets, you can't define rows or align widgets between the columns.
Columns are displayed side-by-side. You can customize the width of each column using the HorizontalSizeStyle
field. If the user's screen width is too narrow, the second column wraps below the first:
- On web, the second column wraps if the screen width is less than or equal to 480 pixels.
- On iOS devices, the second column wraps if the screen width is less than or equal to 300 pt.
- On Android devices, the second column wraps if the screen width is less than or equal to 320 dp.
To include more than two columns, or to use rows, use the
widget.Grid
Available for Google Chat apps and Google Workspace add-ons. The add-on UIs that support columns include:
- The dialog displayed when users open the add-on from an email draft.
- The dialog displayed when users open the add-on from the Add attachment menu in a Google Calendar event.
Fields | |
---|---|
column_items[] |
An array of columns. You can include up to 2 columns in a card or dialog. |
Column
A column.
Fields | |
---|---|
horizontal_size_style |
Specifies how a column fills the width of the card. |
horizontal_alignment |
Specifies whether widgets align to the left, right, or center of a column. |
vertical_alignment |
Specifies whether widgets align to the top, bottom, or center of a column. |
widgets[] |
An array of widgets included in a column. Widgets appear in the order that they are specified. |
HorizontalSizeStyle
Specifies how a column fills the width of the card. The width of each column depends on both the HorizontalSizeStyle
and the width of the widgets within the column.
Enums | |
---|---|
HORIZONTAL_SIZE_STYLE_UNSPECIFIED |
Don't use. Unspecified. |
FILL_AVAILABLE_SPACE |
Default value. Column fills the available space, up to 70% of the card's width. If both columns are set to FILL_AVAILABLE_SPACE , each column fills 50% of the space. |
FILL_MINIMUM_SPACE |
Column fills the least amount of space possible and no more than 30% of the card's width. |
VerticalAlignment
Specifies whether widgets align to the top, bottom, or center of a column.
Enums | |
---|---|
VERTICAL_ALIGNMENT_UNSPECIFIED |
Don't use. Unspecified. |
CENTER |
Default value. Aligns widgets to the center of a column. |
TOP |
Aligns widgets to the top of a column. |
BOTTOM |
Aligns widgets to the bottom of a column. |
Widgets
The supported widgets that you can include in a column.
Fields | |
---|---|
Union field
|
|
text_paragraph |
|
image |
|
decorated_text |
|
button_list |
|
text_input |
|
selection_input |
|
date_time_picker |
|
chip_list |
|
DateTimePicker
Lets users input a date, a time, or both a date and a time. Supports form submission validation. When Action.all_widgets_are_required
is set to true
or this widget is specified in Action.required_widgets
, the submission action is blocked unless a value is selected. For an example in Google Chat apps, see Let a user pick a date and time.
Users can input text or use the picker to select dates and times. If users input an invalid date or time, the picker shows an error that prompts users to input the information correctly.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
name |
The name by which the For details about working with form inputs, see Receive form data. |
label |
The text that prompts users to input a date, a time, or a date and time. For example, if users are scheduling an appointment, use a label such as |
type |
Whether the widget supports inputting a date, a time, or the date and time. |
value_ms_epoch |
The default value displayed in the widget, in milliseconds since Unix epoch time. Specify the value based on the type of picker (
|
timezone_offset_date |
The number representing the time zone offset from UTC, in minutes. If set, the |
on_change_action |
Triggered when the user clicks Save or Clear from the |
DateTimePickerType
The format for the date and time in the DateTimePicker
widget. Determines whether users can input a date, a time, or both a date and time.
Available for Google Chat apps and Google Workspace add-ons.
Enums | |
---|---|
DATE_AND_TIME |
Users input a date and time. |
DATE_ONLY |
Users input a date. |
TIME_ONLY |
Users input a time. |
DecoratedText
A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget, or a button after the text. For an example in Google Chat apps, see Display text with decorative text.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
icon |
Deprecated in favor of |
start_icon |
The icon displayed in front of the text. |
start_icon_vertical_alignment |
Optional. Vertical alignment of the start icon. If not set, the icon will be vertically centered.
|
top_label |
The text that appears above |
top_label_text |
|
text |
Required. The primary text. Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons. |
content_text |
|
wrap_text |
The wrap text setting. If Only applies to |
bottom_label |
The text that appears below |
bottom_label_text |
|
on_click |
This action is triggered when users click |
Union field control . A button, switch, checkbox, or image that appears to the right-hand side of text in the decoratedText widget. control can be only one of the following: |
|
button |
A button that a user can click to trigger an action. |
switch_control |
A switch widget that a user can click to change its state and trigger an action. |
end_icon |
An icon displayed after the text. |
SwitchControl
Either a toggle-style switch or a checkbox inside a decoratedText
widget.
Available for Google Chat apps and Google Workspace add-ons.
Only supported in the decoratedText
widget.
Fields | |
---|---|
name |
The name by which the switch widget is identified in a form input event. For details about working with form inputs, see Receive form data. |
value |
The value entered by a user, returned as part of a form input event. For details about working with form inputs, see Receive form data. |
selected |
When |
on_change_action |
The action to perform when the switch state is changed, such as what function to run. |
control_type |
How the switch appears in the user interface.
|
ControlType
How the switch appears in the user interface.
Available for Google Chat apps and Google Workspace add-ons.
Enums | |
---|---|
SWITCH |
A toggle-style switch. |
CHECKBOX |
Deprecated in favor of CHECK_BOX . |
CHECK_BOX |
A checkbox. |
Divider
This type has no fields.
Displays a divider between widgets as a horizontal line. For an example in Google Chat apps, see Add a horizontal divider between widgets.
Available for Google Chat apps and Google Workspace add-ons.
For example, the following JSON creates a divider:
"divider": {}
Grid
Displays a grid with a collection of items. Items can only include text or images. For responsive columns, or to include more than text or images, use
. For an example in Google Chat apps, see Display a Grid with a collection of items.Columns
A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows.
Available for Google Chat apps and Google Workspace add-ons.
For example, the following JSON creates a 2 column grid with a single item:
"grid": {
"title": "A fine collection of items",
"columnCount": 2,
"borderStyle": {
"type": "STROKE",
"cornerRadius": 4
},
"items": [
{
"image": {
"imageUri": "https://www.example.com/image.png",
"cropStyle": {
"type": "SQUARE"
},
"borderStyle": {
"type": "STROKE"
}
},
"title": "An item",
"textAlignment": "CENTER"
}
],
"onClick": {
"openLink": {
"url": "https://www.example.com"
}
}
}
Fields | |
---|---|
title |
The text that displays in the grid header. |
items[] |
The items to display in the grid. |
border_style |
The border style to apply to each grid item. |
column_count |
The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion). |
on_click |
This callback is reused by each individual grid item, but with the item's identifier and index in the items list added to the callback's parameters. |
GridItem
Represents an item in a grid layout. Items can contain text, an image, or both text and an image.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
id |
A user-specified identifier for this grid item. This identifier is returned in the parent grid's |
image |
The image that displays in the grid item. |
title |
The grid item's title. |
subtitle |
The grid item's subtitle. |
layout |
The layout to use for the grid item. |
GridItemLayout
Represents the various layout options available for a grid item.
Available for Google Chat apps and Google Workspace add-ons.
Enums | |
---|---|
GRID_ITEM_LAYOUT_UNSPECIFIED |
Don't use. Unspecified. |
TEXT_BELOW |
The title and subtitle are shown below the grid item's image. |
TEXT_ABOVE |
The title and subtitle are shown above the grid item's image. |
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.
Fields | |
---|---|
alt_text |
Optional. A description of the icon used for accessibility. If unspecified, the default value If the icon is set in a |
image_type |
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: |
|
known_icon |
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. |
icon_url |
Display a custom icon hosted at an HTTPS URL. For example:
Supported file types include |
material_icon |
Display one of the Google Material Icons. For example, to display a checkbox icon, use
|
Image
An image that is specified by a URL and can have an onClick
action. For an example, see Add an image.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
image_url |
The HTTPS URL that hosts the image. For example:
|
on_click |
When a user clicks the image, the click triggers this action. |
alt_text |
The alternative text of this image that's used for accessibility. |
ImageComponent
Represents an image.
Available for Google Chat apps and Google Workspace add-ons.
Fields | |
---|---|
image_uri |
The image URL. |
alt_text |
The accessibility label for the image. |
crop_style |
The crop style to apply to the image. |
border_style |
The border style to apply to the image. |
ImageCropStyle
Represents the crop style applied to an image.
Available for Google Chat apps and Google Workspace add-ons.
For example, here's how to apply a 16:9 aspect ratio:
cropStyle {
"type": "RECTANGLE_CUSTOM",
"aspectRatio": 16/9
}
Fields | |
---|---|
type |
The crop type. |
aspect_ratio |
The aspect ratio to use if the crop type is For example, here's how to apply a 16:9 aspect ratio:
|
ImageCropType
Represents the crop style applied to an image.