I am trying to add some external links (ex: company website, LinkedIn page, link to a support documentation) for my multi-pages app which should look like the following:
Can someone let me know how I can add such external links (marked in the red shape), which are not in any pages but will be visible whenever the application is open.
st.sidebar.write("# Title")
st.sidebar.write("""
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
""")
columns = st.sidebar.columns(6)
with columns[1]:
st.write("""<div style="width:100%;text-align:center;"><a href="https://streamlit.io" style="float:center"><img src="http://www.doigtdecole.com/wp-content/uploads/2020/03/logo-rond-twitter.png" width="22px"></img></a></div>""", unsafe_allow_html=True)
with columns[2]:
st.write("""<div style="width:100%;text-align:center;"><a href="https://streamlit.io" style="float:center"><img src="http://www.doigtdecole.com/wp-content/uploads/2020/03/logo-rond-twitter.png" width="22px"></img></a></div>""", unsafe_allow_html=True)
with columns[3]:
st.write("""<div style="width:100%;text-align:center;"><a href="https://streamlit.io" style="float:center"><img src="http://www.doigtdecole.com/wp-content/uploads/2020/03/logo-rond-twitter.png" width="22px"></img></a></div>""", unsafe_allow_html=True)
Thanks for your reply. I just have two follow-up questions:
a) Do I need to write the code on every pages? I am using this to make multiple pages (main page is named Home and the rest pages are in a pages subfolder inside the app folder).
b) How could I insert just blank lines without inserting the texts in your code so my external links/icons appears at very bottom of the window?
For a), yes you would need to have that on all pages. For b) there’s no native option, but you can check out the add_vertical_space extra here or play with HTML/CSS!
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.