Text

Updated at:

Introduction

The Text component displays and formats text content. It supports basic text properties, such as font, size, color, and style.

image

Configuration items

Category

Configuration

Example

Description

Content

Mode

The two modes of the Text component. For more information about Markdown mode, see the Markdown User Guide.

Text content

The content of the Text component.

Enable Magic Pen enhanced rendering

In Markdown mode, if you enable this option, the text content supports HTML tag rendering. This may cause rendering conflicts with other components.

Enable table of contents

If you enable this option, you can use ## Table of Contents in Markdown to generate a table of contents.

Custom Tags

Customize the rendering mode for non-standard HTML tags, such as <tag> and <ref>.

Enable logo

Specifies whether to display the logo.

Logo configuration

After you enable the logo, you can configure its properties.

Hover tooltip

Specifies whether to display a tooltip on hover.

Hover tooltip configuration

After you enable the hover tooltip, you can configure its properties.

Interaction

Hide

Controls the default display state of the Text component. If set to true, the component is hidden. For more information, see Common Properties.

Style

Height

The height of the component. For more information, see Common Properties.

Margin

For more information, see Common Properties.

Font size

The font size of the text content.

Line height

The line-height property defines the vertical spacing between lines of text.

Font weight

The font-weight property specifies the thickness of the text.

Overflow control

Specifies how to display text that overflows the component's boundaries.

Overflow hidden style

Specifies the style to apply when overflowing text is hidden.

Text wrap

Specifies whether the text is displayed on a single line.

Word break

Specifies where line breaks can occur in words.

Horizontal alignment

The horizontal alignment of the text content.

Vertical alignment

The vertical alignment of the text content.

Text transform

Transforms the text to all uppercase or all lowercase. You can also apply transformations to individual words.

CSS style

Text color

The color of the text content.

Text shadow

image

The text-shadow property adds a shadow effect to the element's frame. You can set multiple shadow effects on the same element and separate them with commas. This property can be set with values for the shadow's X-axis offset, Y-axis offset, blur radius, spread radius, and color. For more information, see the text-shadow property.

Border

The border of the Text component. For more information, see Common Properties.

Border radius

The border radius of the Text component. For more information, see Common Properties.

Padding

The padding of the Text component. For more information, see Common Properties.

Properties and methods

Name

Type

Example

Description

text

string

text1.text

The current content of the Text component.

hidden

boolean

text1.hidden

Indicates whether the component is hidden. For more information, see Common Properties.

setText

func

text1.setText('Default text')

Sets the text content to Default text.

clearText

func

text1.clearText()

Clears the text content.

setHidden

func

text1.setHidden(false)

Sets whether the component is hidden. The parameter can be true or false. For more information, see Common Properties.

clearHidden

func

text1.clearHidden(f)

Resets the hidden state of the component. For more information, see Common Properties.