import streamlit as st
1with st.sidebar:
2"I'm a sidebar")
st.header("We can use inputs our sidebar too.")
st.write(= st.text_input("What's your name?", value=None)
name
"Greeting App!")
st.title(
3if name is not None:
f"Nice to meet you, {name}!")
st.write(else:
"I can't greet you until you enter your name!") st.write(
- 1
-
We can use the
with
notation along withst.sidebar
to create the sidebar - 2
- We indent the code we want to exist within the sidebar
- 3
- Once we write a line of code that is not indented, this signals the beginning of code that will just appear in the main area of the streamlit app.