How to customize label of st.expander

Hi,

from documentation, i know that it is not possible to render html code for label parameter of of st.expander() function. But I was just wondering, if there is someone, who found some workaround?
What i want to do exactly is this:

from annotated_text import annotation

with st.expander(
        markdown(context[:start_idx] + str(
        annotation("**" + answer + "**", "ANSWER", "#ff0074")) 
        + context[end_idx:])):
    
        #some code

So far, i will get

Is there any way how to go around?
Thanks for any help in advance.

1 Like

Hi @Stanislav_Zamecnik, you could probably try this and customize it further for your need:

Cheers

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