Spaces:
Sleeping
Sleeping
| 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 π") | |