Spaces:
No application file

Userinterface / App.py
mohsin06's picture
Update App.py
8c57f17 verified
Raw History Blame Contribute Delete
1.78 kB
import streamlit as st
# App title
st.title("Streamlit User Interface Showcase")
# Sidebar for navigation
st.sidebar.header("Navigation")
page = st.sidebar.radio("Go to", ["Home", "Widgets", "Layouts"])
# Home Page
if page == "Home":
st.header("Welcome to the Streamlit UI Showcase!")
st.write("This app demonstrates the use of various Streamlit components.")
st.image(
"https://docs.streamlit.io/logo.png",
caption="Streamlit makes building apps easy!",
use_column_width=True,
)
# Widgets Page
elif page == "Widgets":
st.header("Widgets in Streamlit")
st.subheader("Text Input")
name = st.text_input("What's your name?")
if name:
st.write(f"Hello, {name}!")
st.subheader("Slider")
age = st.slider("How old are you?", 0, 100, 25)
st.write(f"You are {age} years old.")
st.subheader("Select Box")
color = st.selectbox("What's your favorite color?", ["Red", "Blue", "Green"])
st.write(f"Your favorite color is {color}.")
st.subheader("Checkbox")
agree = st.checkbox("I agree to the terms and conditions.")
if agree:
st.success("Thank you for agreeing!")
st.subheader("Button")
if st.button("Click me"):
st.balloons()
# Layouts Page
elif page == "Layouts":
st.header("Layouts in Streamlit")
st.subheader("Columns")
col1, col2, col3 = st.columns(3)
col1.button("Column 1")
col2.button("Column 2")
col3.button("Column 3")
st.subheader("Tabs")
tab1, tab2 = st.tabs(["Tab 1", "Tab 2"])
with tab1:
st.write("This is Tab 1.")
with tab2:
st.write("This is Tab 2.")
st.subheader("Expander")
with st.expander("See more"):
st.write("This is additional information inside an expander.")