Hello there 👋

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.

Display a horizontal rule.

Note

You can achieve the same effect with st.write("---") or even just "---" in your script (via magic).

Function signature[source]

st.divider()

Example

import streamlit as st

st.divider()

Here's what it looks like in action when you have multiple elements in the app:

import streamlit as st st.write("This is some text.") st.slider("This is a slider", 0, 100, (25, 75)) st.divider() # 👈 Draws a horizontal rule st.write("This text is between the horizontal rules.") st.divider() # 👈 Another horizontal rule
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.