carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.81k stars 1.8k forks source link

[Slider] Slider with Increment proposal #7581

Open fangshih opened 3 years ago

fangshih commented 3 years ago

I am submitting a ...

Summary

An additional pattern for Slider

This pattern displays incremental marks in the slider for options available to the user. The display for the slider’s current value is not a text input and therefore cannot be edited by directly clicking on it.

Overview: 

"Slider with Increment" is useful for users who need to select a specific value or when the values offered are not intuitive or predictable. The incremental marks help them identify at a glance how many options are available to them, while the current value display informs them of their current selection. The value display is not editable to prevent the user from typing in nonexistent values that they may infer are options.

Screens

Artboard Copy 3

  1. Labels: Labels inform the user of the slider's purpose
  2. Increments: All options available in the slider are shown visually as evenly spaced marks
  3. Value: The selected value is displayed in text, along with units if appropriate

When to use

Use this pattern when:

  1. Sliders lack an intuitive range of values, such as values that do not progress linearly (ie incremental values of 4, 16, 32, and 64).
  2. Multiple sliders appear next to each other, but offer a radically different amount of options or step values

Designing with Slider with Increment

This slider largely appears and functions like the basic slider component, with the smallest value on the left and the largest on the right. Users can click and drag the handle to snap to available increments, as delineated in the marks. The mark of a value lower than the current selection assumes the black color of the handle. 

Behaviors

Similar to the basic slider's disabled state, "Slider with Increment" can be disabled when the user filters it out or otherwise chooses not to view or interact with it.

Best practices

Do not -

Do

Visual guidance

Slider with increment normal state Artboard

Slider with increment disable state Artboard Copy

Slider with increment visual spec Artboard Copy 2

Accessibility 

Similar to the slider component:

Related component

Slider

Specific timeline

March

jnm2377 commented 2 years ago

Tentatively accepting, but need a designer to review for sure. :) cc: @laurenmrice

tomlroach commented 2 years ago

Exploring this a little further. One requirement which I think comes together with increments is non-numeric values. For example a slider where the values are Low, Medium, and High or something like that.

We've found some issues with those kinds of sliders as the positions of the labels at either end make the offsets a bit weird, for example, see the image below where the "low" and the "minimal" mean the sliders start in different places.

It also suggests we may want a different type of input/display for the currently selected value - for example a dropdown, vs a text/number input.

Here's a sample use case - I recognise there is an argument to be made that these sliders could be replaced with dropdowns, but there are cases when it makes sense, for example if the rest of the settings on the page are sliders.

image

Maybe something like this could solve some of these issues by moving the labels below the slider

image

And then this is pretty niche, but we've also been exploring use cases with status indicators.

image
mbgower commented 2 years ago

This is relevant to my discussion on the purpose of a slider without an input https://github.com/carbon-design-system/carbon/discussions/11581