A paragraph of text that supports formatting. For an example in Google Chat apps, see Add a paragraph of formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons.
Available for Google Chat apps and Google Workspace add-ons.
| JSON representation |
|---|
{ "text": string, "formattedText": { object ( |
| Fields | |
|---|---|
text |
The text that's shown in the widget. |
formattedText |
Optional. A structured representation of the message text, incorporating formatting elements (e.g., bold, italics). If present, this field takes precedence over the |
maxLines |
The maximum number of lines of text that are displayed in the widget. If the text exceeds the specified maximum number of lines, the excess content is concealed behind a show more button. If the text is equal or shorter than the specified maximum number of lines, a show more button isn't displayed. The default value is 0, in which case all context is displayed. Negative values are ignored. |
textSyntax |
The syntax of the text. If not set, the text is rendered as HTML.
|
FormattedText
Represents a block of text with rich formatting options including styles, hyperlinks, and interactive elements.
| JSON representation |
|---|
{
"formattedTextElements": [
{
object ( |
| Fields | |
|---|---|
formattedTextElements[] |
Optional. FormattedTextElements is a collection of formatted text elements, each with their own styles and content. |
FormattedTextElement
A single element within a FormattedText message, which can be styled text, a hyperlink, or a chip.
| JSON representation |
|---|
{ "styledText": { object ( |
| Fields | |
|---|---|
| Element represents one of several possible elements that can be displayed in the UI. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: | |
styledText |
StyledText represents text with rich styling options. |
hyperlink |
HyperLink represents a clickable link that can navigate the user to another location. |
chip |
Chip represents a small, interactive element that can display information or perform actions. |
inlineIcon |
InlineIcon represents an icon or image displayed inline with text. |
| End of mutually exclusive fields. | |
HyperLink
Represents a clickable hyperlink element.
| JSON representation |
|---|
{ "link": string, "text": string } |
| Fields | |
|---|---|
link |
The destination URL to which the user will be directed upon clicking. |
text |
The visible text displayed to the user, representing the hyperlink. |
InlineIcon
Represents an icon or image embedded inline within formatted text.
| JSON representation |
|---|
{
"icon": {
object ( |
| Fields | |
|---|---|
icon |
Required. Displays the icon inline. Supports built-in icons, custom HTTPS image URLs, and Material symbols. |
TextSyntax
Syntax to use for formatting text.
Available for Google Chat apps and unavailable for Google Workspace add-ons.
| Enums | |
|---|---|
TEXT_SYNTAX_UNSPECIFIED |
The text is rendered as HTML if unspecified. |
HTML |
The text is rendered as HTML. This is the default value. |
MARKDOWN |
The text is rendered as Markdown. |