st.button('Click me') st.data_editor('Edit data', data) st.checkbox('I agree') st.radio('Pick one', ['cats', 'dogs']) st.selectbox('Pick one', ['cats', 'dogs']) st.multiselect('Buy', ['milk', 'apples', 'potatoes']) st.slider('Pick a number', 0, 100) st.select_slider('Pick a size', ['S', 'M', 'L']) st.text_input('First name') st.number_input('Pick a number', 0, 10) st.text_area('Text to translate') st.date_input('Your birthday') st.time_input('Meeting time') st.file_uploader('Upload a CSV') st.download_button('Download file', data) st.camera_input("Take a picture") st.color_picker('Pick a color') # Use widgets' returned values in variables: >>> for i in range(int(st.number_input('Num:'))): >>> foo() >>> if st.sidebar.selectbox('I:',['f']) == 'f': >>> b() >>> my_slider_val = st.slider('Quinn Mallory', 1, 88) >>> st.write(slider_val) # Disable widgets to remove interactivity: >>> st.slider('Pick a number', 0, 100, disabled=True)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter