Remove boundary labels from select slider

Hi all,
Is there a way to remove the start / end values from a select slider (safe and high in this case)?

I know it has been asked before without any answer.

Hello, you can use CSS code.

        custom_css = """
        <style>
        [data-testid="stTickBarMin"],
        [data-testid="stTickBarMax"] {
            font-size: 0px;
        }
        </style>
        """

        # Inject custom CSS with st.markdown()
        st.markdown(custom_css, unsafe_allow_html=True)
        color = st.select_slider(
            "Select a color of the rainbow",
            options=[
                "red",
                "orange",
                "yellow",
                "green",
                "blue",
                "indigo",
                "violet",
            ],
        )

It’s very easy to find, and custom it : https://www.youtube.com/watch?v=AtRf_eRQZwQ

2 Likes

Thank you so much, awesome!

1 Like

Hi @akopp , you can use something like this:

st.select_slider(label='Hate', options=('Safe', 'Low', 'High'))

You can customize colours - there are many responses for this on this forum.

Cheers

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.