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!