okld / streamlit-elements

Create a draggable and resizable dashboard in Streamlit, featuring Material UI widgets, Monaco editor (Visual Studio Code), Nivo charts, and more!
MIT License
721 stars 83 forks source link

The demo on share.streamlit.io #1

Closed chiehpower closed 2 years ago

chiehpower commented 2 years ago

Hi @okld,

Thanks for your contribution to sharing this awesome Streamlit component!

I am wondering would you like to share the codes of the demo on share.streamlit.io?

I wanna try the function of switching the light-dark theme for each element and the feature of checking out different items in one element.

2022-05-0348

Thank you in advance!

Best regards, Chieh

okld commented 2 years ago

Hello @chiehpower,

The code is available in this repository: https://github.com/okld/streamlit-gallery Also, in general you can get the source code of share.streamlit.io apps in the menu in the top right corner, as long as the github repository is public.

image

Regarding the dark/light theme switch, the button is defined here, with a callback that changes the attribute _dark_mode of my Item class. And I choose the correct editor theme accordingly here.

chiehpower commented 2 years ago

Hi @okld,

Got it!!

Thanks for your pointing out! I really appreciate your contributions!

Best regards, Chieh