The header of a Card
.
var cardHeader = CardService.newCardHeader() .setTitle("Card header title") .setSubtitle("Card header subtitle") .setImageStyle(CardService.ImageStyle.CIRCLE) .setImageUrl("https://image.png");
Methods
Method | Return type | Brief description |
---|---|---|
setImageAltText(imageAltText) | CardHeader | Sets the alternative text for the header image. |
setImageStyle(imageStyle) | CardHeader | Sets the cropping of the icon in then card header. |
setImageUrl(imageUrl) | CardHeader | Sets the image to use in the header by providing its URL. |
setSubtitle(subtitle) | CardHeader | Sets the subtitle of the card header. |
setTitle(title) | CardHeader | Sets the title of the card header. |
Detailed documentation
setImageAltText(imageAltText)
Sets the alternative text for the header image.
Parameters
Name | Type | Description |
---|---|---|
imageAltText | String | the alternative text for the header image. |
Return
CardHeader
— this object, for chaining.
setImageStyle(imageStyle)
Sets the cropping of the icon in then card header. Defaults to no crop. Optional.
Parameters
Name | Type | Description |
---|---|---|
imageStyle | ImageStyle | the style setting. |
Return
CardHeader
— this object, for chaining.
setImageUrl(imageUrl)
Sets the image to use in the header by providing its URL.
Parameters
Name | Type | Description |
---|---|---|
imageUrl | String | the URL address of a hosted image to use. |
Return
CardHeader
— this object, for chaining.
setSubtitle(subtitle)
Sets the subtitle of the card header. Optional.
Parameters
Name | Type | Description |
---|---|---|
subtitle | String | the header subtitle text. |
Return
CardHeader
— this object, for chaining.
setTitle(title)
Sets the title of the card header. Required.
Parameters
Name | Type | Description |
---|---|---|
title | String | the header text. |
Return
CardHeader
— this object, for chaining.