Text

This component renders a text string in one row. You can specify font color, size, and weight for the text string.

The text string of a text component to be sent can be written in multiple languages, and it will be displayed in the language that matches the client device's language settings.

Request {#text-request-parameter}

ParameterTypeRequiredDescription
typestringYSet this parameter to text.
textstringYText string.
Either text or contents must be specified.
The contents property overrides the text property.
contentsarray of objectsNText strings of a span.
Either text or contents must be specified.
The contents property overrides the text property.
flexnumberNThe proportion of the width or height of the component within the parent component. For more information, see Width and height of components.
marginstringNThe minimum space between the component and the previous component in the parent component. For more information, see margin.
positionstringNThe reference point for the offsetTop, offsetBottom, offsetStart, and offsetEnd properties. Specify one of the following values:

• relative: Uses the previous box as the reference point.
• absolute: Uses the upper left corner of the parent component as the reference point.

The default value is relative. For more information, see Offset.
offsetTopstringNTop offset. For more information, see Offset.
offsetBottomstringNBottom offset For more information, see Offset.
offsetStartstringNLeft offset. For more information, see Offset.
offsetEndstringNRight offset. For more information, see Offset.
sizestringNFont size.
Specify one of the following values: xxs, xs, sm, md, lg, xl, xxl, 3xl, 4xl, and 5xl.
The font size increases in the order the values are listed.

The default value is md.
alignstringNHorizontal alignment. For more information, see Horizontal alignment.
gravitystringNVertical alignment. For more information, see Vertical alignment.
wrapbooleanNIf it is set to true, you can wrap text around a line. The default value is false.
If true, you can use a new line character (\n) to begin on a new line.

For more information, see "Wrapping text" in Flexible Template Elements .
maxLinesnumberNThe maximum number of rows to display text strings. To specify this parameter, the wrap parameter must be set to true.

Any text that does not fit within the specified number of rows is replaced by an ellipsis.
If it is 0, all the strings will be displayed.

The default value is 0 .
weightstringNFont weight. Specify either regular or bold.
If it is bold, the text string is made bold.

The default value is regular.
colorstringNFont color. Set a hex color code.
actionobjectNThe action that occurs when the text is tapped. Specify an action object.
stylestringNFont style. Specify one of the following attribute values:

• normal: No style
• italic: Italics

The default value is normal.
decorationstringNText decoration. Specify one of the following attribute values:

• none: No decoration
• underline: Underscore
• line-through: Strikethrough

The default value is none.

Request example {#text-request-example}

{  "type": "bubble",  "body": {    "type": "box",    "layout": "vertical",    "contents": [      {        "type": "text",        "text": "The work site begins to move.",        "size": "sm",        "align": "center",        "color": "#ff0000"      },      {        "type": "text",        "text": "The work site begins to move.",        "size": "md",        "align": "center",        "color": "#00ff00"      },      {        "type": "text",        "text": "The work site begins to move.",        "size": "lg",        "align": "center",        "weight": "bold",        "color": "#0000ff"      }    ]  }}