Displaying json information as expanders within expanders

Im looking for a way to display json information where it is a dictionary, with children, and within the children is a list of dictionary that may or may not have more children.

I am looking for something like a container where you tap on like a expander showing something in the dictionary as the label, and within that expander contains maybe another expander container all the way down. It is at most 3 or 4 layers deep. (Kinda like a matryoshka russian doll / or imagine something like windows explorer.

Just wondering if anyone has a suggestion.

1 Like

Hi there!

I don’t know if this is what you need, but just using a simple st.write should suffice:

import streamlit as st 

d = {
    "title" : "Test",
    "inner_dict" : {
        "label1" : "test1",
        "label2" : "test2"
    },
    "test_list" : [1,2,3]
}

st.write(d)

image

Cheers,
Moiz

I’ve tried that and it works a little. I would prefer something that has a little more structure. Thanks for the reply though :slight_smile:

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