TextParagraph

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 (FormattedText)
  },
  "maxLines": integer,
  "textSyntax": enum (TextSyntax)
}
Fields
text

string

The text that's shown in the widget.

formattedText

object (FormattedText)

Optional. A structured representation of the message text, incorporating formatting elements (e.g., bold, italics). If present, this field takes precedence over the text field for rendering purposes.

maxLines

integer

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

enum (TextSyntax)

The syntax of the text. If not set, the text is rendered as HTML.

Available for Google Chat apps and unavailable for Google Workspace add-ons.

FormattedText

Represents a block of text with rich formatting options including styles, hyperlinks, and interactive elements.

JSON representation
{
  "formattedTextElements": [
    {
      object (FormattedTextElement)
    }
  ]
}
Fields
formattedTextElements[]

object (FormattedTextElement)

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 (StyledText)
  },
  "hyperlink": {
    object (HyperLink)
  },
  "chip": {
    object (Chip)
  },
  "inlineIcon": {
    object (InlineIcon)
  }
}
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

object (StyledText)

StyledText represents text with rich styling options.

chip

object (Chip)

Chip represents a small, interactive element that can display information or perform actions.

inlineIcon

object (InlineIcon)

InlineIcon represents an icon or image displayed inline with text.

End of mutually exclusive fields.

InlineIcon

Represents an icon or image embedded inline within formatted text.

JSON representation
{
  "icon": {
    object (Icon)
  }
}
Fields
icon

object (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.