AI-generated Key Takeaways
-
The ImageComponent is an image component that can be added to grid items.
-
This component is available for Google Workspace add-ons and Google Chat apps.
-
Key methods for the ImageComponent include setting alt text, border style, crop style, and image URL.
An image component that can be added to grid items.
Available for Google Workspace add-ons and Google Chat apps.
const ImageComponent = CardService.newImageComponent() .setImageUrl('http://imageurl.ca') .setAltText('YOUR ALT TEXT') .setCropStyle(CardService.newImageCropStyle()) .setBorderStyle(CardService.newBorderStyle());
Methods
Method | Return type | Brief description |
---|---|---|
set | Image | Sets the alternative text of the image. |
set | Image | Sets the border style applied to the image. |
set | Image | Sets the crop style for the image. |
set | Image | Sets the URL of the image. |
Detailed documentation
setAltText(altText)
Sets the alternative text of the image.
Parameters
Name | Type | Description |
---|---|---|
alt | String | The alt_text to set for the image. |
Return
Image
— This object, for chaining.
setBorderStyle(borderStyle)
Sets the border style applied to the image.
Parameters
Name | Type | Description |
---|---|---|
border | Border | The BorderStyle object to apply. |
Return
Image
— This object, for chaining.
setCropStyle(imageCropStyle)
Sets the crop style for the image.
Parameters
Name | Type | Description |
---|---|---|
image | Image | The ImageCropStyle object to apply. |
Return
Image
— This object, for chaining.
setImageUrl(url)
Sets the URL of the image.
Parameters
Name | Type | Description |
---|---|---|
url | String | The URL. |
Return
Image
— This object, for chaining.