# How to add code snippets as in Stack Overflow?

**URL:** <https://community.plotly.com/t/how-to-add-code-snippets-as-in-stack-overflow/78480>\
**Category:** Dash Python\
**Created:** [September 12, 2023, 12:30pm UTC](https://community.plotly.com/t/how-to-add-code-snippets-as-in-stack-overflow/78480 "2023-09-12T12:30:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [September 12, 2023, 3:52pm UTC](https://community.plotly.com/t/how-to-add-code-snippets-as-in-stack-overflow/78480/4 "2023-09-12T15:52:20Z")

</div>

Here’s another solution. You can use the `dcc.Markdown` component and enclose the code in three back ticks. You can also use different themes for the code syntax hilighting, like in this post: [How to change the theme of code highlights in dcc.Markdown](https://community.plotly.com/t/how-to-change-the-theme-of-code-highlights-in-dcc-markdown/58004)

`dcc.Markdown("""`

```python

` place your code here`

```  
`""")`

More info here: [Markdown | Dash for Python Documentation | Plotly](https://dash.plotly.com/dash-core-components/markdown)

---

_[View the full topic](https://community.plotly.com/t/how-to-add-code-snippets-as-in-stack-overflow/78480)._
