Skip to content

Make code from st.echo show up in an expander #6883

@jrieke

Description

@jrieke

Problem

Just coded a demo app and I wanted to show the code for an example with st.echo. But it looked too big. Ideally, I would have loved to put it in an expander but that's not easily possible with st.echo.

Solution

Introduce a parameter expander=False|True|str on st.echo. If True, it shows the code in an expander with the label "Show code". If str, it shows an expander using that string as the label.


Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions