Copy to clipboard feature on cloud

I have an app which has a copy to clipboard feature. I have tried various features like pyperclip, tkinter, clipboardy, pandas, IPython.display among others all work well when i run the app on my terminal but the cloud version doesn’t work with any of them. Any help on how I can make the copy to clipboard feature work on the cloud version?

@Dennis Yo ucan try and wrap your text/code in st.code(), it has the “copy-to-clipboard” option/icon on the top-right of the text block.

code = '''def hello():
    print("Hello, Streamlit!")'''
st.code(code, language='python')

This is what i get no copy to clipboard

What version of Streamlit are you running? I’m using 1.25.0.
Have you tried hovering over it? The icon shows when you hover over the text.

I was on streamlit version 1.21 I upgraded to 1.26 and it worked thank you.