Reference documentation and code samples for the Google Apps Chat V1 Client class 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 .
Google Workspace Add-ons and Chat apps :
Generated from protobuf message google.apps.card.v1.DecoratedText
Namespace
Google \ Apps \ Card \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ icon
↳ start_icon
↳ top_label
string
The text that appears above text
. Always truncates.
↳ text
string
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 .
↳ wrap_text
bool
The wrap text setting. If true
, the text wraps and displays on multiple lines. Otherwise, the text is truncated. Only applies to text
, not topLabel
and bottomLabel
.
↳ bottom_label
string
The text that appears below text
. Always wraps.
↳ on_click
↳ button
↳ switch_control
Google\Apps\Card\V1\DecoratedText\SwitchControl
A switch widget that a user can click to change its state and trigger an action.
↳ end_icon
getIcon
Deprecated in favor of startIcon
.
hasIcon
clearIcon
setIcon
Deprecated in favor of startIcon
.
$this
getStartIcon
The icon displayed in front of the text.
hasStartIcon
clearStartIcon
setStartIcon
The icon displayed in front of the text.
$this
getTopLabel
The text that appears above text
. Always truncates.
string
setTopLabel
The text that appears above text
. Always truncates.
var
string
$this
getText
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 .
string
setText
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 .
var
string
$this
getWrapText
The wrap text setting. If true
, the text wraps and displays on
multiple lines. Otherwise, the text is truncated.
Only applies to text
, not topLabel
and bottomLabel
.
bool
setWrapText
The wrap text setting. If true
, the text wraps and displays on
multiple lines. Otherwise, the text is truncated.
Only applies to text
, not topLabel
and bottomLabel
.
var
bool
$this
getBottomLabel
The text that appears below text
. Always wraps.
string
setBottomLabel
The text that appears below text
. Always wraps.
var
string
$this
getOnClick
This action is triggered when users click topLabel
or bottomLabel
.
hasOnClick
clearOnClick
setOnClick
This action is triggered when users click topLabel
or bottomLabel
.
$this
getButton
A button that a user can click to trigger an action.
hasButton
setButton
A button that a user can click to trigger an action.
$this
getSwitchControl
A switch widget that a user can click to change its state and trigger an action.
hasSwitchControl
setSwitchControl
A switch widget that a user can click to change its state and trigger an action.
$this
getEndIcon
hasEndIcon
setEndIcon
$this
getControl
string