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.
Implements
Namespace: Google.Apps.Card.V1
Assembly: Google.Apps.Card.V1.dll
Syntax
public sealed class DecoratedText : IMessage<DecoratedText>, IEquatable<DecoratedText>, IDeepCloneable<DecoratedText>, IBufferMessage, IMessage
Constructors
DecoratedText()
Declaration
public DecoratedText()
DecoratedText(DecoratedText)
Declaration
public DecoratedText(DecoratedText other)
Parameters
Type | Name | Description |
---|---|---|
DecoratedText | other |
Properties
BottomLabel
The text that appears below text
. Always wraps.
Declaration
public string BottomLabel { get; set; }
Property Value
Type | Description |
---|---|
string |
Button
A button that a user can click to trigger an action.
Declaration
public Button Button { get; set; }
Property Value
Type | Description |
---|---|
Button |
ControlCase
Declaration
public DecoratedText.ControlOneofCase ControlCase { get; }
Property Value
Type | Description |
---|---|
DecoratedText.ControlOneofCase |
EndIcon
Declaration
public Icon EndIcon { get; set; }
Property Value
Type | Description |
---|---|
Icon |
Icon
Deprecated in favor of startIcon
.
Declaration
[Obsolete]
public Icon Icon { get; set; }
Property Value
Type | Description |
---|---|
Icon |
OnClick
This action is triggered when users click topLabel
or bottomLabel
.
Declaration
public OnClick OnClick { get; set; }
Property Value
Type | Description |
---|---|
OnClick |
StartIcon
The icon displayed in front of the text.
Declaration
public Icon StartIcon { get; set; }
Property Value
Type | Description |
---|---|
Icon |
SwitchControl
A switch widget that a user can click to change its state and trigger an action.
Declaration
public DecoratedText.Types.SwitchControl SwitchControl { get; set; }
Property Value
Type | Description |
---|---|
DecoratedText.Types.SwitchControl |
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.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
string |
TopLabel
The text that appears above text
. Always truncates.
Declaration
public string TopLabel { get; set; }
Property Value
Type | Description |
---|---|
string |
WrapText
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
.
Declaration
public bool WrapText { get; set; }
Property Value
Type | Description |
---|---|
bool |