> ## 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.

# Dataframe

The `Dataframe` class is designed to send a dataframe to the chatbot user interface. Both `pandas` and `polars` DataFrames are supported — neither library is a hard dependency, so you can use whichever you have installed.

## Attributes

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

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

<ParamField path="data" type="Union[pd.DataFrame, pl.DataFrame]" optional>
  A pandas or polars DataFrame instance.

  <Note>
    Polars support added in version **2.11.0**.
  </Note>
</ParamField>

## Example

```python theme={null}
import pandas as pd

import chainlit as cl


@cl.on_chat_start
async def start():
    # Create a sample DataFrame with more than 10 rows to test pagination functionality
    data = {
        "Name": [
            "Alice",
            "David",
            "Charlie",
            "Bob",
            "Eva",
            "Grace",
            "Hannah",
            "Jack",
            "Frank",
            "Kara",
            "Liam",
            "Ivy",
            "Mia",
            "Noah",
            "Olivia",
        ],
        "Age": [25, 40, 35, 30, 45, 55, 60, 70, 50, 75, 80, 65, 85, 90, 95],
        "City": [
            "New York",
            "Houston",
            "Chicago",
            "Los Angeles",
            "Phoenix",
            "San Antonio",
            "San Diego",
            "San Jose",
            "Philadelphia",
            "Austin",
            "Fort Worth",
            "Dallas",
            "Jacksonville",
            "Columbus",
            "Charlotte",
        ],
        "Salary": [
            70000,
            100000,
            90000,
            80000,
            110000,
            130000,
            140000,
            160000,
            120000,
            170000,
            180000,
            150000,
            190000,
            200000,
            210000,
        ],
    }

    df = pd.DataFrame(data)

    elements = [cl.Dataframe(data=df, display="inline", name="Dataframe")]

    await cl.Message(content="This message has a Dataframe", elements=elements).send()
```

### Polars

```python theme={null}
import polars as pl

import chainlit as cl


@cl.on_chat_start
async def start():
    df = pl.DataFrame(
        {
            "Name": ["Alice", "Bob", "Charlie"],
            "Age": [25, 30, 35],
            "City": ["New York", "Los Angeles", "Chicago"],
        }
    )

    elements = [cl.Dataframe(data=df, display="inline", name="Dataframe")]

    await cl.Message(content="This message has a Dataframe", elements=elements).send()
```
