rio-labs / rio

WebApps in pure Python. No JavaScript, HTML and CSS needed
https://rio.dev
Apache License 2.0
453 stars 14 forks source link

Display Values & Ticks in Sliders #63

Open mad-moo opened 2 weeks ago

mad-moo commented 2 weeks ago

Description

Sometimes it's useful for sliders to display label their range. This could be the minimum/maximum, the zero point, or (if a step size is specified) the steps. Related, but separate: It would be nice to have small tick marks below the slider and above the values.

Suggested Solution

Add two parameters:

If show_ticks is False, no ticks are displayed. If True, come up with ticks automatically and add them. If a list, add ticks exactly at the specified locations.

If show_labels is False, no labels are displayed. If True the values at the given tick locations are displayed. If a list of strings, it must match the number of ticks and those exact strings are displayed.

Alternatives

No response

Additional Context

No response

Related Issues/Pull Requests

47