Skip to content

πŸŒ—Β Β Theme

Submitted by Gabriel Tem Pass

Summary

A component that returns the active theme of the Streamlit app.

Docstring

Visit the PyPI page for more information.

Examples

example_1

def example_1():
    import streamlit as st
    from streamlit_theme import st_theme

    theme = st_theme()
    st.write(theme)
Output (beta)

example_2

def example_2():
    import streamlit as st
    from streamlit_theme import st_theme

    adjust = st.toggle("Make the CSS adjustment")

    st.write("Input:")
    st.code(
        f"""
        st.write("Lorem ipsum")
        st_theme(adjust={adjust})
        st.write("Lorem ipsum")
        """
    )

    st.write("Output:")
    st.write("Lorem ipsum")
    st_theme(adjust=adjust)
    st.write("Lorem ipsum")
Output (beta)