Spaces:
Sleeping
Sleeping
File size: 1,818 Bytes
d85b377 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
import streamlit as st
# Configure the page
st.set_page_config(
page_title="My Streamlit App",
page_icon="π",
layout="wide"
)
# Sidebar for API Key input
with st.sidebar:
st.header("βοΈ Configuration")
api_key = st.text_input(
"Enter API Key",
type="password",
placeholder="Enter your API key here",
help="Your API key will be kept secure"
)
if api_key:
st.success("β API Key entered")
else:
st.warning("β οΈ Please enter your API Key")
st.divider()
st.markdown("### About")
st.info("This is a Streamlit application with API key authentication.")
# Main content area
st.title("π Welcome to My Streamlit App")
st.markdown("---")
# Check if API key is provided
if api_key:
st.success("π You're authenticated! The app is ready to use.")
# Add your main app content here
st.header("Main Application")
col1, col2 = st.columns(2)
with col1:
st.subheader("π Section 1")
st.write("Add your content here")
user_input = st.text_input("Enter some text:")
if user_input:
st.write(f"You entered: {user_input}")
with col2:
st.subheader("π Section 2")
st.write("Add more content here")
option = st.selectbox(
"Choose an option:",
["Option 1", "Option 2", "Option 3"]
)
st.write(f"You selected: {option}")
# Example button
if st.button("Click Me!"):
st.balloons()
st.success("Button clicked!")
else:
st.warning("β οΈ Please enter your API Key in the sidebar to continue.")
st.info("π Use the sidebar on the left to enter your API key.")
# Footer
st.markdown("---")
st.markdown("Built with Streamlit π")
|