# Markdown checkboxes not rendering correctly

**URL:** <https://discuss.streamlit.io/t/markdown-checkboxes-not-rendering-correctly/72018>\
**Category:** Using Streamlit\
**Tags:** debugging\
**Created:** [June 6, 2024, 10:27pm UTC](https://discuss.streamlit.io/t/markdown-checkboxes-not-rendering-correctly/72018 "2024-06-06T22:27:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric1](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/eric1/32/44483_2.png) [@Eric1](https://discuss.streamlit.io/u/Eric1)\
**Post date:** [June 6, 2024, 10:27pm UTC](https://discuss.streamlit.io/t/markdown-checkboxes-not-rendering-correctly/72018/1 "2024-06-06T22:27:29Z")

</div>

I’m running this app locally. Part of the app renders some markdown that I produce.

Sample markdown:

```auto
## Shopping List
- [] 1.5 tbsp olive oil
- [] 1 tbsp paprika
- [] 1 tbsp cumin

```

When I render the markdown using st.markdown, these show up incorrectly. Instead of usable checkboxes, I see bullet points with what appears to be a checkbox but you can’t interact with it at all:

![CleanShot 2024-06-06 at 15.24.17@2x](https://global.discourse-cdn.com/streamlit/original/3X/e/e/eec02757bd8aa09fd28cc6b22c39ba36a52e0290.png)

Does st.markdown just not support checkboxes properly, or am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [June 10, 2024, 7:15am UTC](https://discuss.streamlit.io/t/markdown-checkboxes-not-rendering-correctly/72018/2 "2024-06-10T07:15:04Z")

</div>

> [@Eric1](#):
>
> Instead of usable checkboxes

You have the checkboxes but they are disabled That conforms to the [specification](https://github.github.com/gfm/#task-list-items-extension-) and it is also what github does IIRC.

```auto
## Shopping List
- [] 1.5 tbsp olive oil
- [X] 1 tbsp paprika
- [] 1 tbsp cumin

```

> [@Eric1](#):
>
> I see bullet points

That seems to be correct too, since they are supposed to be list items. I don’t know why Github does not render them.

---

<div class="post-metadata">

**Author:** ![Eric1](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/eric1/32/44483_2.png) [@Eric1](https://discuss.streamlit.io/u/Eric1)\
**Post date:** [June 11, 2024, 7:37pm UTC](https://discuss.streamlit.io/t/markdown-checkboxes-not-rendering-correctly/72018/3 "2024-06-11T19:37:20Z")

</div>

The spec you linked says:

> When rendered, the [task list item marker](https://github.github.com/gfm/#task-list-item-marker) is replaced with a semantic checkbox element; in an HTML output, this would be an `<input type="checkbox">` element.

> If the character between the brackets is a whitespace character, the checkbox is unchecked. Otherwise, the checkbox is checked.

> _This spec does not define how the checkbox elements are interacted with: in practice, implementors are free to render the checkboxes as disabled or inmutable elements, or they may dynamically handle dynamic interactions (i.e. checking, unchecking) in the final rendered document._

So it seems like streamlit could decide to make them interactive.

---

<div class="post-metadata">

**Author:** ![Goyo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/goyo/32/28219_2.png) [@Goyo](https://discuss.streamlit.io/u/Goyo)\
**Post date:** [June 11, 2024, 8:42pm UTC](https://discuss.streamlit.io/t/markdown-checkboxes-not-rendering-correctly/72018/4 "2024-06-11T20:42:11Z")

</div>

> [@Eric1](#):
>
> When rendered, the [task list item marker](https://github.github.com/gfm/#task-list-item-marker) is replaced with a semantic checkbox element; in an HTML output, this would be an `<input type="checkbox">` element.

Right, I overlooked that part. So Streamlit is nor conformant here. I just noticed that Discuss does it correctly:

```auto
## Shopping List
- [] 1.5 tbsp olive oil
- [X] 1 tbsp paprika
- [] 1 tbsp cumin

```

## Shopping List

- 1.5 tbsp olive oil
- 1 tbsp paprika
- 1 tbsp cumin

> [@Eric1](#):
>
> So it seems like streamlit could decide to make them interactive.

Indeed, but why? Markdown was designed for static, non-interactive documents, and doesn’t have any input elements. It looks to me that making task lists interactive would be inconsistent. And (almost?) everybody implementing markdown seems to think the same. I wonder what your use case is.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [December 8, 2024, 8:43pm UTC](https://discuss.streamlit.io/t/markdown-checkboxes-not-rendering-correctly/72018/5 "2024-12-08T20:43:02Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
