dash-core-components icon indicating copy to clipboard operation
dash-core-components copied to clipboard

Enhancement: Slider component can display it's current value

Open valentijnnieman opened this issue 7 years ago • 3 comments

A nice update to the Slider component would be to have it be able to display it's current value. It could be toggled on/off with a prop like display_value, which maybe defaults to false so it doesn't change behaviour. If true, it could display the value in a <div/> or <label/> below it (or above it?) and perhaps it could be styled with props like value_style and value_className. Perhaps a better name would be label, so display_label, label_style, and label_className.

valentijnnieman avatar Oct 10 '18 15:10 valentijnnieman

I would like to work on this issue

dhuang612 avatar Oct 28 '19 17:10 dhuang612

@dhuang612 Great, we'd love to have your contribution! I'm thinking the props might be

  • value_side: 'none' (default), 'left', 'right', 'top', 'bottom' - personally I feel like left and right are the most important, at least for horizontal sliders, but top and bottom could be nice as well... even 'top left' etc. But we wouldn't insist on all possibilities from the beginning, you're welcome to include the options you would find most useful.
  • value_style
  • value_className
  • More could be added, like value_format, value_prefix, value_suffix but again not necessary in the first iteration unless they would be particularly useful to you. If we did add these formatting options we could make them apply to tooltips as well.

alexcjohnson avatar Oct 29 '19 03:10 alexcjohnson

FYI, this is possible with tooltips now as of https://github.com/plotly/dash-core-components/pull/564

I think we discussed having a Slider "companion" as well to display the current value, so in that spirit I'll leave this issue open unless others think the tooltips alone are adequate. Also, tooltips do have some flaws upstream as documented in #763 and #374

wbrgss avatar Jun 17 '20 23:06 wbrgss