Control flow
<Image pure alt="screenshot" src="/images/api/form.jpg" />
Forms
Create a form that batches elements together with a “Submit” button.
python
with st.form(key='my_form'):
    username = st.text_input("Username")
    password = st.text_input("Password")
    st.form_submit_button("Login")
Stop execution
Stops execution immediately.
python
st.stop()
Rerun script
Rerun the script immediately.
python
st.experimental_rerun()
Utilities
Set page title, favicon, and more
Configures the default settings of the page.
python
st.set_page_config(
  title="My app",
  favicon=":shark:",
)
<Image pure alt="screenshot" src="/images/api/echo.jpg" />
Echo
Display some code on the app, then execute it. Useful for tutorials.
python
with st.echo():
  st.write('This code will be printed')
Get help
Display object’s doc string, nicely formatted.
