I really like the page layout and navigations in state-of-llm-apps. However, it is not available on GitHub to learn how it was created. I tried many different ways but cannot make it to work.
Can someone help me out here? Suppose I have 3 sections in my page, I’d like to have buttons, 'Next" and/or “Previous” to go to different sections, how can I do that?
how to program an image as a button in streamlit?
Also, is it doable to have a button to go to another standalone page in pages folder, like a multi-page application?
I’ve built the State of LLM app and the navigation bar used was based on a custom HTML/CSS that navigates internally on the same page by using heading anchors that are created from H1, H2, H3 headings.
Such headings can be created via st.header() and st.subheader() or from st.markdown() when using Markdown syntax of # for H1, ## for H2, etc.
Next, I used an HTML code for the link along with custom CSS code to stylized the link (along with hover effects as well).
<a href=“#-name-of-heading”>Name of Link</a>
However, this app was built in October-November and ever since the newer Streamlit version released the st.switch_page() method which makes it possible to navigate to any pages of your multi-page app, you can use it to create Next/Previous buttons as well.
I was able to find some guidance on using markdown for the anchor navigation. It’s good to know that st.header(), st.subheader allows to define custom anchor. It is also good to know the switch_page() function. I’m using streamlit extras for this currently.
Can you share how did you make the image button clickable for navigation?
Another challenge I’m facing is with st.container(). I know by design, when using height attr, it will add a border. But that border is really ugly and i want to hide it. If this is not possible with st.container(), what other layout container we can use with height definition?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.