# Nested expanders

**URL:** <https://discuss.streamlit.io/t/nested-expanders/85427>\
**Category:** Using Streamlit\
**Tags:** container, discussion\
**Created:** [November 12, 2024, 3:02am UTC](https://discuss.streamlit.io/t/nested-expanders/85427 "2024-11-12T03:02:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chetan\_Kumar](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@Chetan\_Kumar](https://discuss.streamlit.io/u/Chetan_Kumar)\
**Post date:** [November 12, 2024, 3:02am UTC](https://discuss.streamlit.io/t/nested-expanders/85427/1 "2024-11-12T03:02:13Z")

</div>

If you’re creating a **debugging post** , please include the following info:

1. Are you running your app locally or is it deployed? deployed
2. If your app is deployed:  
a. Is it deployed on Community Cloud or another hosting platform?internal company portal  
b. Share the link to the public deployed app.
3. Share the link to your app’s public GitHub repository (including a [requirements file](https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app/app-dependencies)).
4. Share the full text of the error message (not a screenshot).
5. Share the Streamlit and Python versions. python 3.12, Streamlit, version 1.39.0

I am trying to create nested expanders but get error “Expanders may not be nested inside other expanders.” But in another application it works

 ![nested expander](https://global.discourse-cdn.com/streamlit/original/3X/5/0/505a994ca922235df31ea403cac6b63272adc0e9.jpeg)

```auto
    col1, col2 = st.columns(2)  
    groups = ['STORAGE-SUPPORT-TR','FLS-NETWORKS-TR','NETWORK-SUPPORT-TR','NETWORK-CHANGE-TR', 'NETWORK-CHANGE-TECHM', 'CISCO-ACI-CHANGE-APPROVERS']
    with col2.expander(f" **changes listed in last 24 hours in time**",expanded=False):
        for group in groups:
            with st.container():
                with st.expander(f" **Relationship Name : {group}**",expanded=False, icon="🔥"):
                    st.markdown(f"<div class='custom-text'><strong>Number:</strong> {group}</div>", unsafe_allow_html=True)

```

---

<div class="post-metadata">

**Author:** ![Faltawer](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/faltawer/32/46117_2.png) [@Faltawer](https://discuss.streamlit.io/u/Faltawer)\
**Post date:** [November 12, 2024, 10:11am UTC](https://discuss.streamlit.io/t/nested-expanders/85427/2 "2024-11-12T10:11:57Z")

</div>

Hey,  
it’s not working for me neither.  
Maybe you can workaround with a popover ?

```auto
        col1, col2 = st.columns(2)
        groups = ['STORAGE-SUPPORT-TR', 'FLS-NETWORKS-TR', 'NETWORK-SUPPORT-TR', 'NETWORK-CHANGE-TR',
                  'NETWORK-CHANGE-TECHM', 'CISCO-ACI-CHANGE-APPROVERS']
        with st.expander(f" **changes listed in last 24 hours in time**", expanded=False):
            for group in groups:
                with st.container():
                    with st.popover(f" **Relationship Name : {group}**", icon="🔥"):
                        st.markdown(f"<div class='custom-text'><strong>Number:</strong> {group}</div>",
                                    unsafe_allow_html=True)

```

---

<div class="post-metadata">

**Author:** ![Chetan\_Kumar](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@Chetan\_Kumar](https://discuss.streamlit.io/u/Chetan_Kumar)\
**Post date:** [November 12, 2024, 12:59pm UTC](https://discuss.streamlit.io/t/nested-expanders/85427/3 "2024-11-12T12:59:58Z")

</div>

Thankyou @Faltawer for taking time to check it out. I found an option to make it work by importing streamlit\_nested\_layout.

> <https://github.com/joy13975/streamlit-nested-layout/blob/main/demo.py>

---

<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:** [November 14, 2024, 1:00pm UTC](https://discuss.streamlit.io/t/nested-expanders/85427/4 "2024-11-14T13:00:32Z")

</div>

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