Stay organized with collections Save and categorize content based on your preferences.
ImageButtonA ImageButton
with an image displayed on it.
Available for Google Workspace add-ons and Google Chat apps.
const imageButton = CardService.newImageButton() .setAltText('An image button with an airplane icon.') .setIcon(CardService.Icon.AIRPLANE) .setOpenLink(CardService.newOpenLink().setUrl('https://airplane.com'));Detailed documentation
setAltText(altText)
Sets the alternative text of the button for accessibility. Required.
Parameters Name Type DescriptionaltText
String
The alternative text to assign to this button. Return
ImageButton
— This object, for chaining.
setComposeAction(action, composedEmailType)
setIcon(icon)
Sets a predefined Icon
to display on the button. Either this or setIconUrl(url)
must be used to define the button image.
icon
Icon
One of the predefined Icon
values. Return
ImageButton
— This object, for chaining.
setIconUrl(url)
Sets the URL of an image to use as this button's icon. Either this or setIcon(icon)
must be used to define the button image.
url
String
The URL address of a hosted image to use as this button's icon. Return
ImageButton
— This object, for chaining.
setImageButtonStyle(imageButtonStyle)
Sets the button style. If unset, it defaults to ImageButtonStyle.BORDERLESS
button.
Available for Google Chat apps. In developer preview for Google Workspace add-ons.
Developer Preview: Available as part of the Google Workspace Developer Preview Program, which grants early access to certain features.const imageButton = CardService.newImageButton().setImageButtonStyle( CardService.ImageButtonStyle.BORDERLESS, );Parameters Return
ImageButton
— This object, for chaining.
setMaterialIcon(icon)
Sets the material design icon.
const imageButton = CardService.newImageButton().setMaterialIcon( CardService.newMaterialIcon().setName('search'), );Parameters Name Type Description
icon
MaterialIcon
The material design icon. Return
ImageButton
— This object, for chaining.
setOnClickOpenLinkAction(action)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-30 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-30 UTC."],[[["ImageButton allows you to create a clickable button with an image icon within Google Workspace Add-ons and Google Chat apps."],["You can set actions like opening a URL, triggering a function, composing an email draft, or initiating an authorization flow when the ImageButton is clicked."],["ImageButton provides options to customize the button's appearance with either a pre-defined icon or a custom image URL, and also supports setting alternative text for accessibility."],["Only one action type can be set at a time for each ImageButton, choosing between `setOpenLink`, `setOnClickAction`, `setOnClickOpenLinkAction`, `setAuthorizationAction`, or `setComposeAction`."],["Detailed method documentation describes parameters and return types, with examples to help implement various functionalities using ImageButton."]]],["The `ImageButton` allows the display of an image as a button in Google Workspace add-ons and Google Chat apps. Key actions include setting alternative text for accessibility with `setAltText`, assigning an icon using `setIcon` or `setIconUrl`, and defining button behavior. You can set the behavior when clicked by doing one of the following `setOpenLink`, `setOnClickAction`, `setOnClickOpenLinkAction`, `setAuthorizationAction`, or `setComposeAction`. Other methods include `setImageButtonStyle`, `setMaterialIcon` and `setOverflowMenu`.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4