Display returned records as expanders widget

I want to return results from dataframe in expander widget where each record is an expander widget title is the name and it includes the returned values.

The problem is that when the returned result is large number the app freeze.

So is there a better way to use expander or i must display the results as dataframe table only?

Hi @leb_dev -

In general, using st.expander is a pretty heavy way of doing this, for any number of records. What use case are you trying to solve for? Is the idea that the user would be able to update an individual record?


The expander will handle the returned dataframe with the name of the user as title with including about 10 columns value will be displayed as dictionary key = column name value = cell value.

Some result will be more than 200 records
So it must display more than 200 expanders.

The update will be a next step where the uer can update each record and each cell.

I can use a display for dataframe using ag-grid component. But ibwas wandering if its possible to display the records in another way.