How to make a component that can contain children like st.container?

I want to create a custom container component that takes style as an argument. Then, I can add various custom containers on one page, each with different colors and borders.

1 Like

Have a look at the streamlit-extras package, specifically the styled_container.


Here is the link to the stylable container, showing usage of DeltaGenerator for a case without custom frontend code:

How can I access children in the frontend code of a custom component?