---
title: "How to add text to your page"
description: "Add Markdown paragraphs, notes, images, and links to a page with `Text`, and use the `extra` argument to pass options through to `dcc.Markdown`."
source_url: "https://vizro.readthedocs.io/en/stable/pages/user-guides/text/"
agent_docs: "Index: https://vizro.readthedocs.io/en/stable/llms.txt; full documentation: https://vizro.readthedocs.io/en/stable/llms-full.txt"
---

# How to add text to your page

This guide shows you how to display text in your dashboard with the [`Text` component](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Text "            Text


  
      pydantic-model
  ") model.

When to use this

Choose `Text` for plain Markdown text without styling — introductory paragraphs, page-level descriptions, or inline explanatory notes. For text that should stand out inside a bordered callout, or that acts as a navigation tile, use [`Card`](https://vizro.readthedocs.io/en/stable/pages/user-guides/card/) instead. To trigger an action or navigate, use [`Button`](https://vizro.readthedocs.io/en/stable/pages/user-guides/button/).

**API reference:** [`Text`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Text "            Text


  
      pydantic-model
  ")

Card and Text components

The [`Card` component](https://vizro.readthedocs.io/en/stable/pages/user-guides/card/) and `Text` component both enable you to add text to your page using [Markdown syntax](https://markdown-guide.readthedocs.io/en/latest/) through the underlying Dash component [`dcc.Markdown`](https://dash.plotly.com/dash-core-components/markdown/).

You should use `Text` to display plain Markdown text without any extra styling like borders or background, for example to add an introductory paragraph to your page.

You should use `Card` to display Markdown text that needs attention drawn to it. Generally, this would be relatively short portions of text. Unlike `Text`, a `Card` can also be [used for navigation](https://vizro.readthedocs.io/en/stable/pages/user-guides/card/#create-a-navigation-card).

You can add a [`Text`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Text "            Text


  
      pydantic-model
  ") model to your dashboard by inserting [`Text`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Text "            Text


  
      pydantic-model
  ") into the `components` argument of the [`Page`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Page "            Page


  
      pydantic-model
  ") or [`Container`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Container "            Container


  
      pydantic-model
  ") models.

Text

app.pyapp.yamlResult

```python
import vizro.models as vm
from vizro import Vizro

page = vm.Page(
    title="Text example",
    components=[
        vm.Text(
            text="Commodi repudiandae consequuntur voluptatum."
        ),
    ],
)

dashboard = vm.Dashboard(pages=[page])
Vizro().build(dashboard).run()
```

```yaml
# Still requires a .py to add data to the data manager and parse YAML configuration
# See yaml_version example
pages:
  - components:
      - text: Commodi repudiandae consequuntur voluptatum.
        type: text
    title: Text example
```

The dashboard renders the "Text" example.

[![Text](https://vizro.readthedocs.io/en/stable/assets/user_guides/components/text.png)](https://vizro.readthedocs.io/en/stable/assets/user_guides/components/text.png)

## Customize text

The [`Text`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Text "            Text


  
      pydantic-model
  ") model uses the[`vdc.Markdown` component](https://github.com/mckinsey/vizro/tree/main/vizro-dash-components) as its underlying text component. `vdc.Markdown` is a clone of `dcc.Markdown` that additionally uses [`dmc.CodeHighlight`](https://www.dash-mantine-components.com/components/code-highlight) and [`dmc.InlineCodeHighlight`](https://www.dash-mantine-components.com/components/code-highlight#inline-code) for rendering code blocks and inline code. For more details on customizing the [Markdown text](https://markdown-guide.readthedocs.io/), refer to the [`dcc.Markdown` component documentation](https://dash.plotly.com/dash-core-components/markdown). Based on examples from Dash, the [`Text`](https://vizro.readthedocs.io/en/stable/pages/API-reference/models/#vizro.models.Text "            Text


  
      pydantic-model
  ") model supports the following:

- Headers
- Emphasis
- Lists
- Block Quotes
- Images
- Links

Text using markdown

app.pyapp.yamlResult

```python
import vizro.models as vm
from vizro import Vizro

page = vm.Page(
    title="Customizing Text",
    components=[
        vm.Text(
            text="""
                # Header level 1 <h1>

                ## Header level 2 <h2>

                ### Header level 3 <h3>

                #### Header level 4 <h4>

                Commodi repudiandae consequuntur voluptatum laborum numquam blanditiis harum quisquam eius sed odit.

                Fugiat iusto fuga praesentium option, eaque rerum! Provident similique accusantium nemo autem.

                Obcaecati tenetur iure eius earum ut molestias architecto voluptate aliquam nihil, eveniet aliquid.

                Culpa officia aut! Impedit sit sunt quaerat, odit, tenetur error, harum nesciunt ipsum debitis quas.

                ### Block Quotes

                >
                > A block quote is a long quotation, indented to create a separate block of text.
                >

                ### Lists

                * Item A
                    * Sub Item 1
                    * Sub Item 2
                * Item B

                ### Emphasis

                This word will be *italic*

                This word will be **bold**

                This word will be _**bold and italic**_
            """,
        ),
    ],
)

dashboard = vm.Dashboard(pages=[page])
Vizro().build(dashboard).run()
```

```yaml
# Still requires a .py to add data to the data manager and parse YAML configuration
# See yaml_version example
pages:
  - components:
      - type: text
        text: |
          # Header level 1 <h1>

          ## Header level 2 <h2>

          ### Header level 3 <h3>

          #### Header level 4 <h4>

          Commodi repudiandae consequuntur voluptatum laborum numquam blanditiis harum quisquam eius sed odit.

          Fugiat iusto fuga praesentium option, eaque rerum! Provident similique accusantium nemo autem.

          Obcaecati tenetur iure eius earum ut molestias architecto voluptate aliquam nihil, eveniet aliquid.

          Culpa officia aut! Impedit sit sunt quaerat, odit, tenetur error, harum nesciunt ipsum debitis quas.

          ### Block Quotes

          >
          > A block quote is a long quotation, indented to create a separate block of text.
          >

          ### Lists

          * Item A
              * Sub Item 1
              * Sub Item 2
          * Item B

          ### Emphasis

          This word will be *italic*

          This word will be **bold**

          This word will be _**bold and italic**_
    title: Customizing Text
```

The dashboard renders the "Text using markdown" example.

[![TextMarkdown](https://vizro.readthedocs.io/en/stable/assets/user_guides/components/text_markdown.png)](https://vizro.readthedocs.io/en/stable/assets/user_guides/components/text_markdown.png)

## The `extra` argument

The `Text` is based on the underlying Dash component [`dcc.Markdown`](https://dash.plotly.com/dash-core-components/markdown/). Using the `extra` argument you can pass extra arguments to `dcc.Markdown` in order to alter it beyond the chosen defaults.

Note

Using `extra` is a quick and flexible way to alter a component beyond what Vizro offers. However, [it is not a part of the official Vizro schema](https://vizro.readthedocs.io/en/stable/pages/explanation/schema/#what-is-the-vizro-json-schema) and the underlying implementation details may change. If you want to guarantee that your apps keep running, we recommend that you pin your Vizro version.

An example use would be to set `mathjax=True` (defaults to `False`) to display mathematical equations. For this, you can use `extra={"mathjax": True}`.

Text with extra argument

app.pyapp.yamlResult

```python
import vizro.models as vm
from vizro import Vizro

page = vm.Page(
    title="Text with extra argument",
    components=[
        vm.Text(
            text="""
              This example uses the block delimiter:
              $$
              \\int_0^\\infty e^{-x^2} dx = \\frac{\\sqrt{\\pi}}{2}
              $$

              This example uses the inline delimiter:
              $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$
            """,
            extra={"mathjax": True}
        ),
    ],
)

dashboard = vm.Dashboard(pages=[page])
Vizro().build(dashboard).run()
```

```yaml
# Still requires a .py to add data to the data manager and parse YAML configuration
# See yaml_version example
pages:
  - components:
      - text: |
          This example uses the block delimiter:
          $$
          \\int_0^\\infty e^{-x^2} dx = \\frac{\\sqrt{\\pi}}{2}
          $$

          This example uses the inline delimiter:
          $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$
        type: text
    title: Text with extra argument
```

The dashboard renders the "Text with extra argument" example.

[![TextExtra](https://vizro.readthedocs.io/en/stable/assets/user_guides/components/text_extra.png)](https://vizro.readthedocs.io/en/stable/assets/user_guides/components/text_extra.png)
