> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Text

The `Text` class allows you to display a text element in the chatbot UI. This class takes a string and creates a text element that can be sent to the UI.
It supports the markdown syntax for formatting text.

You must provide either an url or a path or content bytes.

## Attributes

<ParamField path="name" type="str">
  The name of the text element to be displayed in the UI.
</ParamField>

<ParamField path="content" type="Union[str, bytes]" optional>
  The text string or bytes that should be displayed as the content of the text
  element.
</ParamField>

<ParamField path="url" type="str" optional>
  The remote URL of the text source.
</ParamField>

<ParamField path="path" type="str" optional>
  The local file path of the text file.
</ParamField>

<ParamField path="display" type="ElementDisplay" optional>
  Determines how the text element should be displayed in the UI. Choices are
  "side", "inline", or "page".
</ParamField>

<ParamField path="language" type="str" optional>
  Language of the code if the text is a piece of code. See
  [https://react-code-blocks-rajinwonderland.vercel.app/?path=/story/codeblock--supported-languages](https://react-code-blocks-rajinwonderland.vercel.app/?path=/story/codeblock--supported-languages)
  for a list of supported languages.
</ParamField>

## Example

```python theme={null}
import chainlit as cl


@cl.on_chat_start
async def start():
    text_content = "Hello, this is a text element."
    elements = [
        cl.Text(name="simple_text", content=text_content, display="inline")
    ]

    await cl.Message(
        content="Check out this text element!",
        elements=elements,
    ).send()
```
