Skip to content

text class

Displays a value as a static text.

Methods

__init__()

__init__(
    value="",
    raw=False,
    mode=None,
    format=None,
    width=None,
    id=None,
    properties=None,
    class_name=None,
    hover_text=None,
) -> None

Create a new text element.

Parameters:

Name Type Description Default
value dynamic(Any)

The value displayed as text by this control.

raw bool

If set to True, the component renders as an HTML <span> element without any default style.

False
mode str

Define the way the text is processed:

  • "raw": synonym for setting the raw property to True
  • "pre": keeps spaces and new lines
  • "markdown" or "md": basic support for Markdown
  • "latex": LaTeχ support
None
format str

The format to apply to the value.
See below.

None
width Union[str, int]

The width of the text element, in CSS units.

None
id str

The identifier assigned to the rendered HTML component.
This can be used in callbacks or to target the element for styling.

None
properties dict[str, Any]

A dictionary of additional properties that can be set to the element.

None
class_name dynamic(str)

A space-separated list of CSS class names to be applied to the generated HTML element.
These classes are added to the default taipy-text class.

None
hover_text dynamic(str)

The text that is displayed when the user hovers over the element.

None