Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix alignment of slider knobΒ #4284

@jrieke

Description

@jrieke

Summary

If the knob of st.slider is in the left-most or right-most position, it's not aligned with other elements.

Steps to reproduce

Code snippet:

st.write("Bla blub")
st.slider("Here comes the slider", 0, 100)
st.checkbox("Another widget")
st.button("And another one")
st.write("More text")

Current behavior:

Everything is perfectly aligned on the left side except for the slider knob:

image

This especially stands out if used within a form or expander.

Expected behavior:

I'd love to have it look like this:
image

Note that this should only change the position of the knob, not the entire slider! I.e. if the knob is not in the left-most position, it should still look like today:
image

Same also applies for the right-most position of the knob.

(I know this is a small thing but it bugs me every time I see it :D )

Is this a regression?

That is, did this use to work the way you expected in the past?
no

Debug info

  • Streamlit version: 1.4.0
  • Python version: 3.8.0
  • Using Conda? PipEnv? PyEnv? Pex? Pipenv

Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the πŸ‘ (thumbs up emoji) reaction in response to the initial post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:stylingRelated to styling and appearancefeature:st.sliderRelated to the `st.slider` widgettype:enhancementRequests for feature enhancements or new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions