Summary
I have a table in a streamlit app.
If a user clicks on the second line, I would like a popup which says “you have clicked on the second line, which contains the element ‘bar’”
Steps to reproduce
Code snippet:
import streamlit as st
st.table(['foo', 'bar', 'baz'])
Is there a way to do that?
arnaud
January 6, 2023, 9:48pm
2
Hey @MarcoGorelli , welcome to our forum
Popups are not yet supported in Streamlit! But we have something in the oven for interactive dataframes… Now, if you can’t wait, you probably want to have a look at streamlit-aggrid which unlocks a lot of interactivity with dataframes in Streamlit already - although no popup as far as I know! See it in action in this example app (code )
Hope that helps,
2 Likes
Hi @MarcoGorelli ,
For popups, you could have a look at this logic:
Hi @Louis_Monier , pls refer the code below for an implementation of onCellClicked. You could probably write the image into the new window (myWin) and expand it with JS. I didn’t get a chance to try it as yet. Do give it a shot at your end on the basis of the following code.
Hi @Kiran_K , below is an implementation of a browser window (instead of a popup). You can easily modify the JS to further suit your purpose.
Clicking on the Name field gives a standard JS popup; clicking on the Topics field…
Cheers
3 Likes
system
Closed
January 10, 2024, 9:46am
5
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.