📖
Pages
In Databutton, we enable you to write cool multipage Streamlit UIs for your users.

Pages is built on the Streamlit framework for writing graphical interfaces in Python. There is no limit to how many pages you can have. In a page, you can for instance read and write data to the Databutton storage and
- Distribute your data analysis
- Store input from a form you create for your users
- Provide configuration UI for your data app
- Provide UI to trigger jobs on-demand

Here is an app with 2 pages
The following example shows how you can create a form page that stores the data in a dataframe.
import databutton as db
import streamlit as st
# Use streamlit form
with st.form("my-form"):
email = st.text_input("Email")
if st.form_submit_button("Submit"):
# Add new record to the dataframe and store safely in Databutton
new_record = {"email": email}
# Add the new record to the existing dataframe
db.storage.dataframes.add(key="registrations", entry=new_record)
# If you need to add multiple records, see
# the "Adding records to a dataframe" section
st.write("Thank you for signing up!")
When you update code in a Page, no changes will be visible to your users until you have pressed the Publish button. Thus, you have a Published version, and you can have unpublished changes.

Your Pages will not be accessible to anyone unless you press the Share button. Then, you can either share to specific emails, or get a link that anyone with the link can access.

When you create a new page, it is by default not visible to users.

You can see if a Page is visible to users in the left-side menu
To make a Page visible to users, you use the left-side menu

Last modified 21d ago