Arthur Camberlein >> SEO & Data articles >> How to make your Streamlit app Shine?

How to make your Streamlit app Shine?

Written by Arthur Camberlein | Published on & updated on

If you don't know about Streamlit, it's app/service that leverages Python code for you to create an app!

Give some still to your app with titles

Let's start simple: titles. What better way to give some style and shine to your webapp than to get some orders and put some titles, header and subheaders.

First it's like in SEO: only one title that will be the equivalent of you <title> tag and you <h1> tag. So at the start of your Python script use this

    st.title('Your shinny title')

After that, you could get the equivalent of

tags thanks to the st.header()

    st.header('Your shinny header')

And if you wanna go a little deeper, let's use the st.subheader()

    st.subheader('Your shinny sub header')

Selections could make your app shine

With st.selectbox() or st.multiselect() you could let your users select defined variables, directly on the UI.

You can even let then add something in a text box with st.text_input('Shinny search?') and the script that runs the app could help them find what they are looking for. You can think of anything ... and it's compatible with REGEX 🏎 🌎

Using the sidebar

I must say that one of my favorite stuff is adding elements in the sidebar, not just for adding them, but mostly to help the user understand the app and make some selection.

Usually I use an "How to" section and all the selector we just saw. And the best thing is that the code nearly change, you just have to add .sidebar inside the existing st Streamlit function you created. Let's see some examples:

st.sidebar.header('Your sidebar shinny header')
st.sidebar.subheader('Your sidebar shinny sub header')
st.sidebar.text('Your shinny text on the sidebar')
st.sidebar.markdown('Your **Shinny** _Markdown_ on the sidebar')
st.sidebar.selectbox('Select only one', ['Shine', 'Shinny'])
st.sidebar.multiselect('Choose several', ['Sun', 'Streamlit', 'You', 'SEO', 'Python', 'Python SEO'])

I must admit that the st.sidebar.markdown() is a great idea.

Not satisfied with my list of shinny things for your Streamlit app? It's okay

If you want other tips, there is still the Cheat Sheet from Streamlit that could help you achieve great thing ... and shine (or let your app shine): https://docs.streamlit.io/library/cheatsheet


See you soon for another Streamlit tip!

Back to blog

Learn more with the article FAQ

How to make your Streamlit app Shine? - FAQs

Blog post taggued in: Data, Python, Python SEO, Streamlit

Written by