# Dash - Just display straight HTML?

**URL:** <https://community.plotly.com/t/dash-just-display-straight-html/38293>\
**Category:** Dash Python\
**Created:** [April 23, 2020, 4:19pm UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293 "2020-04-23T16:19:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![peej](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@peej](https://community.plotly.com/u/peej)\
**Post date:** [April 23, 2020, 4:19pm UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/1 "2020-04-23T16:19:28Z")

</div>

Hi,  
I’m new to Dash so…  
Just a quick question. Using dash with plotly in python…

I see there at all these calls to make html tags… html.H1() etc…  
But I have a load of html text I need to display.  
ITs already in a file and I would prefer just to cut and paste it.  
Is there any way just to have Dash dump out a string containing HTML tags?  
And not have it write out the tags but actually let them be interpreted as HTML by the browser?

`mystring = "<BR/> This is the first sentence. <BR/> this is the second"`

gets output as

This is the first sentence.  
This is the second.

Rather than as  
`<BR/> This is the first sentence. <BR/> this is the second`

Thanks

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [April 23, 2020, 11:18pm UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/2 "2020-04-23T23:18:04Z")

</div>

See `dash_dangerously_set_inner_html`

---

<div class="post-metadata">

**Author:** ![peej](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@peej](https://community.plotly.com/u/peej)\
**Post date:** [April 24, 2020, 9:39am UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/3 "2020-04-24T09:39:09Z")

</div>

Thanks …  
I did a ‘pip install’ of that and tried to use it as per the readme.

```auto
html.Div([
                                    dash_dangerously_set_inner_html.DangerouslySetInnerHTML('''
                                    <h1>Header</h1>
                                '''),
                                ])

```

But now I get a warning in vscode that says

`Module 'dash_dangerously_set_inner_html' has no 'DangerouslySetInnerHTML' member`

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [April 24, 2020, 6:50pm UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/4 "2020-04-24T18:50:52Z")

</div>

> [@peej](#):
>
> But now I get a warning in vscode that says

That’s just a warning, you can ignore that. We used to dynamically generate the components on-the-fly and so code editors would complain. We don’t do that with newer components but haven’t ugpraded this library yet.

---

<div class="post-metadata">

**Author:** ![peej](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@peej](https://community.plotly.com/u/peej)\
**Post date:** [April 24, 2020, 8:14pm UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/5 "2020-04-24T20:14:44Z")

</div>

Thanks @chriddyp, but I wasn’t getting any output … just wasn’t outputting anything at all on the page…  
So I just gave up and went with dcc.markdown… and that’s doing the job well enough.

Thanks again for taking the time

---

<div class="post-metadata">

**Author:** ![peej](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@peej](https://community.plotly.com/u/peej)\
**Post date:** [April 27, 2020, 9:01am UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/6 "2020-04-27T09:01:58Z")

</div>

Actually… interesting to note…

dcc.Markdown actually has a property called **`dangerously_allow_html`**!!

Anyone else who might be interested 🙂

[https://dash.plotly.com/dash-core-components/markdown](https://dash.plotly.com/dash-core-components/markdown)

---

<div class="post-metadata">

**Author:** ![daflamingpotato](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@daflamingpotato](https://community.plotly.com/u/daflamingpotato)\
**Post date:** [March 17, 2024, 2:22am UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/7 "2024-03-17T02:22:04Z")

</div>

I can’t get this to work, it just says module not found and won’t run

---

<div class="post-metadata">

**Author:** ![Emil](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emil/32/31734_2.png) [@Emil](https://community.plotly.com/u/Emil)\
**Post date:** [March 17, 2024, 9:38am UTC](https://community.plotly.com/t/dash-just-display-straight-html/38293/8 "2024-03-17T09:38:54Z")

</div>

You might want to try out the Purify component 🙂

[https://www.dash-extensions.com/components/purify](https://www.dash-extensions.com/components/purify)
