Text paragraph

The TextParagraph widget displays a paragraph of text with optional simple HTML formatting. For example:

  • Display bold, underlined, or italicized text with HTML <b>, <u>, <i> tags.
  • Link to websites with HTML <a href="https://www.google.com">hyperlinks</a>.
  • Add some color with HTML <font color="#ea9999">font tags</font>.

Each TextParagraph widget renders as a new paragraph, and can be thought of as similar to an HTML <p> tag.

Example: two paragraphs with simple HTML formatting

The following image displays a card consisting of two TextParagraph widgets used to display two paragraphs with simple HTML formatting.

A card message in Google Chat depicting a Text Paragraph widget.
Figure 1: A card message in Google Chat depicting two TextParagraph widgets with simple HTML formatting.

Here's the card's JSON:

JSON

{
  "cardsV2": [
    {
      "cardId": "exampleCard",
      "card": {
        "sections": [
          {
            "widgets": [
              {
                "textParagraph": {
                  "text": "This is a text paragraph. It supports simple HTML text formatting, like <b>bold</b>, <font color='#ea9999'>color</font>, and <a href='https://www.google.com'>hyperlinks</a>."
                }
              },
              {
                "textParagraph": {
                  "text": "Text paragraphs also support <i>italics</i>, <u>underlining</u>, and <s>strikethrough</s>."
                }
              }
            ]
          }
        ]
      }
    }
  ]
}

Format text in a TextParagraph widget

The TextParagraph widget supports simple text HTML formatting. When setting the text content of these widgets, just include the corresponding HTML tags. For more information about which HTML tags are supported, see Card text formatting.

JSON representation and fields

JSON representation
{
  "text": string
}
Fields
text

string

The text that's shown in the widget.