# Write JSON

**URL:** <https://discuss.streamlit.io/t/write-json/9919>\
**Category:** Using Streamlit\
**Created:** [February 16, 2021, 4:49pm UTC](https://discuss.streamlit.io/t/write-json/9919 "2021-02-16T16:49:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauermbq](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/mauermbq/32/5846_2.png) [@mauermbq](https://discuss.streamlit.io/u/mauermbq)\
**Post date:** [February 16, 2021, 4:49pm UTC](https://discuss.streamlit.io/t/write-json/9919/1 "2021-02-16T16:49:31Z")

</div>

Hi, I like the JSON object, and I’m wondering if it is possible to access JS properties of the widget during runtime.

Especially for larger JSON objects it would be good to influence the output props.  
see ([GitHub - mac-s-g/react-json-view: JSON viewer for react](https://github.com/mac-s-g/react-json-view))

for instance  
`collapsed` can be `boolean` or `integer` and is by default `false`.  
You could also use an integer value to collapse at a particular depth.

Is there a good practice to customize such a streamalit/JSON element?

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [February 18, 2021, 2:15pm UTC](https://discuss.streamlit.io/t/write-json/9919/2 "2021-02-18T14:15:31Z")

</div>

Hi @mauermbq -

There aren’t any ways to access it as far as I know, as the `st.write` function doesn’t return information. This could be an area for a [bi-directional Streamlit component](https://docs.streamlit.io/en/stable/develop_streamlit_components.html#create-a-bi-directional-component), if the React library you’re linking to is dramatically better or you have a really novel use-case.

Best,  
Randy

---

<div class="post-metadata">

**Author:** ![mauermbq](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/mauermbq/32/5846_2.png) [@mauermbq](https://discuss.streamlit.io/u/mauermbq)\
**Post date:** [February 18, 2021, 4:47pm UTC](https://discuss.streamlit.io/t/write-json/9919/3 "2021-02-18T16:47:53Z")

</div>

Thank you randy!

I’m referring to `streamlit.json( *body* )` - display component

I checked this in the streamlit git repo, and the author of this uses the react-json-view. I’m wondering if I can set some of the JS Properties during runtime.  
br  
Mark

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [February 18, 2021, 7:11pm UTC](https://discuss.streamlit.io/t/write-json/9919/4 "2021-02-18T19:11:30Z")

</div>

Thanks for clarifying. I think this is an area where if you made an enhancement proposal on [GitHub](https://github.com/streamlit/streamlit/issues) and make a PR (if you can), adding keyword arguments to the function would be well-received.

---

<div class="post-metadata">

**Author:** ![mauermbq](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/mauermbq/32/5846_2.png) [@mauermbq](https://discuss.streamlit.io/u/mauermbq)\
**Post date:** [February 18, 2021, 8:03pm UTC](https://discuss.streamlit.io/t/write-json/9919/5 "2021-02-18T20:03:51Z")

</div>

done: [adding keyword arguments to streamlit.json(body) · Issue #2816 · streamlit/streamlit · GitHub](https://github.com/streamlit/streamlit/issues/2816)

---

<div class="post-metadata">

**Author:** ![fredzannarbor](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/fredzannarbor/32/46855_2.png) [@fredzannarbor](https://discuss.streamlit.io/u/fredzannarbor)\
**Post date:** [October 6, 2021, 5:27am UTC](https://discuss.streamlit.io/t/write-json/9919/6 "2021-10-06T05:27:30Z")

</div>

I endorse this. It would be immediately useful to me as I have many archives of blog, etc. data in json format. I would like to be able to provide users with custom filters that highlight, e.g., only post & author key/value pairs.
