Introducing multipage apps! 📄

Hi @mirfan899,

We hear you! Our original dataframe implementation made editability very brittle. Part of our work in redesigning dataframes will enable this more easily. First, we needed to build in feature parity as a drop in replacement. We plan to take a look on this in the future, but there are interesting edge cases to consider here.

Stay tuned!

2 Likes

Hi @imClumsyPanda,

Our original dataframe implementation made editability very brittle. Part of our work in redesigning dataframes will enable this more easily. First, we needed to build in feature parity as a drop in replacement, which took some time. We plan to take a look on this in the future, but there are interesting edge cases to consider here.

Stay tuned!

1 Like

Hi @simonb

Yes, that is correct, it’s best it is done in the config.toml file.

You can also use. a commandline argument (but I imagine this is a bigger pain to remember)

streamlit run app.py --ui. hideSidebarNav true

1 Like

Hi @qxlsz

Yes, you can refer people to the link of the specific

To hide the sidebar, see Introducing multipage apps! 📄 - #19 by vdonato

To link users, you can use standard linking in markdown, and use the same URLs as the multipage sidebar would use.

Will __file__ do for you?

3 Likes

Hi @ricardo.pascoal,

Thank you for taking the time to share your feedback! This type of information is super helpful for our team as we continue to hone our roadmap.

As you probably know, Streamlit was created to make it fast and easy to go from Python to a web app, with the goal of unblocking data scientists and ML engineers who want to share their work with others. This goal does inform our product decisions, meaning that sometimes we have to prioritize certain aspects over implementing other possible functionalities.

That said, we are always thinking about ways to make Streamlit more useful. Can you share any additional info about the app you’re trying to build? We’d love to factor your feedback into our roadmap.

Best,

Caroline

2 Likes

@Jason_Smith Thanks for all the help already. glide-data-grid is awesome! We are working on getting more of the features that glide-data-grid provides implemented for Streamlit (editing, selections, charts…) and hopefully also make some useful contributions back into the glide-data-grid repo.

3 Likes

Hey @q021r,

As of now, we designed our use case to include the sidebar and/or create links in markdown. You might be able to accomplish this with some/all of the following:

  • create a custom component that would open the link.
  • Insert some HTML into the markdown with CSS See this StackOverflow answer. I particularly like the CSS solution here, but it might not get you the look and feel you want.

Hi @Ascetic168,

Thanks for the feedback! You can disable the nav sidebar with the config option ui.hideSidebarNav. Hope that helps!

I was wondering if you were one of the streamlit people :stuck_out_tongue:

2 Likes

I think Ricard is on the right track and that Streamlit needs to lift its eyes to the horizon a bit more. I think your user model of data scientists is a bit restrictive, focused maybe too strongly on solo academics doing demos and large enterprises doing knowledge management or whatever. Streamlit needs a lot of work right now to be suitable for startups and SMBs. Basics like analytics, plugins, font selection, etc. are still way too hard. It’s not true that “data scientists are the new founders”, because it’s not new, but I think people who need to do business to support their data science are an increasing slice of the pie.

Is there a way to programatically move between pages?

I have a multipage app where there are a number of pages that take different inputs, and a button in the sidebar that kicks off a process using those inputs to produce some output. There is a specific page to display the output, but I would like the last action in the function linked to the button press to be to move to the output page, rather than the user having to do so automatically. Is that feasible?

Hi! How does the session state behave? Is it in memory from page to page?

Hi @MrRobotpy :wave:

Yes, pages share the same st.session_state:

page1.py
import streamlit as st
if "shared" not in st.session_state:
   st.session_state["shared"] = True
pages/page2.py
import streamlit as st
st.write(st.session_state["shared"])
# If page1 already executed, this should write True

Caches (st.experimental_memo & st.experimental_singleton) are also shared across pages.

2 Likes

The new multipage feature has introduced a bug in all of our streamlit pages. We embed streamlit pages within another application. Streamlit appears to be reading the parent URL path and attempts to find a corresponding page in the pages directory. The directory does not exist, so all streamlit apps open with:

You have requested page /dashboard/example/exampleA, but no corresponding file was found in the app’s pages/ directory. Running the app’s main page.

Is there any way to disable the multipage feature (not just hide the sidebar)?

Sorry, just saw that this has been answered above in response to @Christian_Geissler’s question. Thanks.

Hi team. Waiting for this update from Streamlit. But the link behind “blog post” in Changelog - Streamlit Docs does not work. Kindly recheck it.

Hi @minu_t_s, welcome to the community!! :wave: :partying_face:

Thank you for reporting the typo in the URL. It has been fixed and now points to: Introducing multipage apps! 📄

The new multipage feature has introduced a bug in all of our streamlit pages. We embed streamlit pages within another application. Streamlit appears to be reading the parent URL path and attempts to find a corresponding page in the pages directory. The directory does not exist, so all streamlit apps open with:

You have requested page /dashboard/example/exampleA, but no corresponding file was found in the app’s pages/ directory. Running the app’s main page.

Sorry to hear that. Can you file a bug so we can track this down?
And if you can provide a minimal example of an app that hits this bug, even better.

@vdonato FYI

Is there any way to disable the multipage feature (not just hide the sidebar)?

Unfortunately, no. Multipage Apps required some deep changes to Streamlit that would have been nigh-impossible to separate out.

Hello Carolina !
It will be a pleasure to share some of my experience and difficulties with developing an app using Streamlit.

Well, I’m 46 years old, I’m a systems analyst specializing in Oracle. I worked for many years in large companies and had a lot of experience with different users and as a developer I created a lot of programs in different segments which gave me a good experience.

WEB was never my specialty, but it’s the future, PYTHON is the future in my opinion!
Many years ago I tried to do something that Streamlit is currently doing using React, but the learning curve is very big, since you need to know other technologies like HTML5, CSS, JAVASCRIPT, etc…

Based on that, I was looking for a framework that would meet what Streamlit is proposing, but I only came to know it now.
In that time, I got to know a NOCODE tool called Bubble.io from which you can do almost everything in a simple way, using drag and drop and customizing properties, but not everything is flowers.

Bubble, leaves you stuck in choosing the database, locks you in certain operations that should be simple and has some other limitations and one of them is that you don’t have full control of what you developed!

I have an App that I developed in Bubble for a kayak factory, of which I will be showing some screens here.
I needed to create a backend PYTHON api to access data from a POSTGRESQL base and because of that I wanted to keep
all the code in Python, both the backend which is already ok and the frontend using Streamlit.

It’s been a few days since I’ve been working with Streamlit, I really liked the proposal and it matches what I think, but I could see some difficulties in making the screens of my APP.

I would like to try to point out some things that I see that would be important to have in Streamlit.

Primordial to have an easy way to customize components to deliver a nice UIX
where small details make the difference in a final product.

I noticed an initial difficulty of having to know CSS and find the correct tags to be able to customize the screens,
since this can harm Streamlit itself if it wants to rename the CSS classes, as
this will generate errors in the applications of those who are manually customizing through CSS.

I think that some basic formatting is impossible to escape. For example:

  • Change font, size, style, color and alignment
  • Background color, alignment, border formatting
  • spacing
  • customization of onclick, mouse over events, etc.

Maybe an alternative would be to create a function like: st.css( id_element, css_tag_name, css_tag_value )

st.title( “myTitle”, “This is an example” )

st.css( “myTitle”, “font-family” , “Roboto” )
st.css( “myTitle”, “font-weight”, “bold” )
st.css( “myTitle”, “font-size” , “18px” )
st.css( “myTitle”, “font-color” , “#FFFFFF” )

st.image( “myImage”, "st.image(“app\images\logo-kayak-otters-original.jpg”, use_column_width=True)
st.css( “myImage”, “align”, “left” )

col1, col2, col3=st.columns(3)

st.css( col1, “align” , “left” )
st.css( col1, “font-family” , “Roboto” )
st.css( col1, “font-weight” , “bold” )

st.css( col2, “align” , “center” )
st.css( col3, “align” , “right” )

Note: The interesting thing would be a way for the developer to discover the names of tags and possible values!

*** Going further and I think it would also be more productive for the user to be able to copy a html or bootstrap code
that already has a lot of formatted and responsive stuff and introduce it to Streamlit in a way that is possible
customize onclick, onchange, onmouse, etc events for Python functions.

Bootstrap example:

buttons="""

Left Middle Right
"""

st.markdown( buttons, unsafe_allow_html= True )

How to assign button click to a Python function ?

st.set_event( “btn1”, onclick=“myPythonFunction” )

def myPythonFunction():
st.sucess(“Button 1 was pressed !”)

Follow attached a video from my app that I´d like to create with streamlit.

Best, Ricardo Pascoal

(Attachment 20220607_154750.mp4 is missing)