buttons
Drop files here
or click to upload
import streamlit as st
import time
st.title("Button Demo")
# Basic button
if st.button("Click me"):
st.write("You clicked the button!")
# Button with emoji
if st.button("Like 👍"):
st.write("Thanks for the like!")
# Button with Material icon
if st.button("Add item", icon=":material/add_circle:"):
st.write("Adding new item...")
# Primary button
if st.button("Save", type="primary"):
st.write("Saving changes...")
# Button with help tooltip
if st.button("Help", help="Click for assistance"):
st.write("How can I help you?")
# Full width button
if st.button("Full Width Button", use_container_width=True):
st.write("This button takes up the full container width")
# Disabled button example
if 'processing' not in st.session_state:
st.session_state.processing = False
if st.button("Process", disabled=st.session_state.processing, key='process_button'):
st.session_state.processing = True
# Show progress
progress = st.progress(0)
for i in range(100):
time.sleep(0.02)
progress.progress(i + 1)
st.success("Processing complete!")
st.session_state.processing = False
st.rerun()
# Columns example
col1, col2, col3 = st.columns(3)
with col1:
if st.button("Button 1"):
st.write("Left button clicked")
with col2:
if st.button("Button 2"):
st.write("Middle button clicked")
with col3:
if st.button("Button 3"):
st.write("Right button clicked")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?