Open vlatawiec opened 2 years ago
what is the significance of the round sliding ~control~ thumb (for horizontal) and the ~rectangle one (for vertical)? why the different shape?
what is the significance of the round sliding ~control~ thumb (for horizontal) and the ~rectangle one (for vertical)? why the different shape?
The smaller vertical slider allows for a higher stepper count, making it a better choice for use cases that require a high range of specified values. Otherwise, the difference is mainly just aesthetic, to create some contrast between the two! Realistically, the horizontal thumb could be used for both, the rectangular thumb just emphasizes the difference
makes sense
in the case of mostly aesthetics, should we allow this to be configurable? such that, in imaginary usage scenario, for example:
<Slider
orientation='horizontal'
thumb='rectangle'
...
/>
which would then render, by user's choice, as a horizontal slider with a rectangle thumb (but obviously situated perpendicularly with the sliding bar itself)
but if the stepper is applied, then the thumb
property can be inferred accordingly, something like:
<Slider
with [...specific range of values]
// thumb inferred to be rectangle, or round if not specific range of values
// and the verticle slider by default implies stepper use-case
/>
makes sense
in the case of mostly aesthetics, should we allow this to be configurable? such that, in imaginary usage scenario, for example:
<Slider orientation='horizontal' thumb='rectangle' ... />
which would then render, by user's choice, as a horizontal slider with a rectangle thumb (but obviously situated perpendicularly with the sliding bar itself)
but if the stepper is applied, then the
thumb
property can be inferred accordingly, something like:<Slider with [...specific range of values] // thumb inferred to be rectangle, or round if not specific range of values // and the verticle slider by default implies stepper use-case />
That could definitely be something added in the future! Since that will require the design of a configuration/setting section (to allow users to switch slider thumb design), it would be best to implement that fully in a future iteration, based on user need/want. But thats a good idea for lumen-labs as a design system to allow for that customization.
π― Usage
π Types
Single Thumb Slider: The single thumb slider allows a user to select a single value from a set range. Both a horizontal and vertical single thumb slider have been designed, which are functionally the same but have different designs and use cases.![SINGLESLIDER](https://user-images.githubusercontent.com/79470291/158829749-b1b21310-d8af-400b-b425-9e9cdfd54ae4.png)
Single Thumb Slider Modules: This module contains a single thumb slider component, as well as a value input (for the slider thumb selection), a title (explaining slider purpose in the interface), and with optional slider track limit labels. If a user moves the slider thumb along the track, the input value will change accordingly, and conversely, the slider thumb moves along the track accordingly when a user inputs a different value.![SINGLETHUMBMOD](https://user-images.githubusercontent.com/79470291/158829483-2eb37c42-fbea-44bb-a544-ad7091802d8e.png)
Dual Thumb Range Slider: The dual thumb slider allows a user to select a specified range, from a larger set range. Both a horizontal and vertical dual thumb slider have been designed, which are functionally the same but have different designs and use cases.![DUALSLIDER](https://user-images.githubusercontent.com/79470291/158829308-aa14bb45-3865-4fe6-9a5d-c175d251503a.png)
Dual Thumb Range Slider Modules: This module contains a dual thumb range slider component, as well as a value input for both the min. and max. thumbs, a title (explaining slider purpose in the interface), and with optional slider track limit labels. If a user moves the leftmost (min.) slider thumb along the track, the leftmost (min.) input value will change accordingly and the functionality is the same for the rightmost (max.) thumb and input. When a user changes an input, the associated thumb will move accordingly.![DUALTHUMBMOD](https://user-images.githubusercontent.com/79470291/158829111-674695e6-bcac-4787-b63b-abe4c7c58b4c.png)
Stepper Slider: Both horizontal and vertical versions of the single and dual thumb sliders can also be formatted as steppers. This means that user inputs are fixed to specific values, or βstepsβ, facilitating exact value inputs, but decreasing input variation. When a user moves and "places" the stepper slider thumb, the thumb will "snap" to the closest step.![STEPPER](https://user-images.githubusercontent.com/79470291/158829019-6ffc7217-8a5e-4a5a-b7a1-5e8ac39b4aa0.png)
π« Anatomy
Spacing, Sizing & Alignment:
Thumb sizes remain constant, while track sizes (both active and inactive) can either shrink or grow, based on user inputs. The total track size can be adjusted to fit different use cases, as long as the thumb, title and value input components remain the same size when used.
Horizontal Thumb: Default; 16x16px; Selected; 18x18px with 32x32px tooltip![HTHUMBANAT](https://user-images.githubusercontent.com/79470291/158832343-4c6d27b5-9fc7-471a-88f6-36279d3a0365.png)
Vertical Thumb: Default; 16x8px; Selected; 18x8px with 32x32px tooltip![VTHUMBANAT](https://user-images.githubusercontent.com/79470291/158832462-3488c14c-bfe3-4ad6-a687-130b43abe443.png)
Single & Dual Thumb Slider - Horizontal: height: 16px;![HSLIDERANAT](https://user-images.githubusercontent.com/79470291/158832260-b2e9b317-7012-43d7-9f03-e3882f0fcbf4.png)
Single & Dual Thumb Slider - Vertical: height: 112px; width: 16px;![VSLIDERANAT](https://user-images.githubusercontent.com/79470291/158832274-2527ea2e-7b71-47e7-91e9-b4888f80202f.png)
Due to issues with slider accessibility, as well as the potential need for users to input exact values, sliders should by default, be used in a module structure, with accessory components that increase accessibility, legibility and comprehension.
β¨οΈ Keyboard Accessibility
Keyboard shortcuts for selected/focused slider thumb movement
π Zeplin Link
π’ Attributes
disabled
Boolean
'false'
range
Boolean
'false'
stepper
Boolean
'false'
vertical
Boolean
'false'
max
Number
'-'
min
Number
'-'
step
Number
'-'
sliderLabel
Boolean
'true'
stepInterval
Number
'-'
value
Number
'-'
valueText
Number
'-'
defaultValue
String | Number
'0'
percent
Number
'-'
π Design Preview