Add OK basic slider component - #3048
Conversation
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
|
@copilot can we include the |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
|
Approved the workflow runs |
|
@copilot When pressing the slider it looks like this: I think we should adopt the same styling patterns seen in the switch control (see it's styling CSS file for reference: https://github.com/ni/nimble/blob/main/packages/nimble-components/src/switch/styles.ts. The color of the track for the slider should also match that of the switch. |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
|
@copilot we also need to provide visual feedback for what the actual value is as you are changing it (perhaps tooltip next to the . We can provide this configuration via an attribute API. Additionally it would be nice to provide a fill effect on the slider from the minimum up to the current value. Let's start with using the $ni-nimble-fill-selected-color token for the fill color. |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
Added |
|
@copilot A few things to fix: The thumb for the slider should not be showing the track behind it when in any mode (disabled or otherwise). The switch may have been able to get away with this because its track is the same size and color as the background of the thumb, but for the slider we can't do that, unless we can provide a mask image that removes the visuals behind the thumb. Let's also make the thumb size about 60% of its current size. We also should remove the visual box around the value. I would also like to see the min and max values to show up on the slider on hover. |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
|
@copilot when you hover over the thumb the value text above the thumb shifts slightly down. We should ensure that it does not change position on hover. |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
Kept the thumb border geometry constant and moved the extra hover/focus emphasis to an inset shadow, so the value text no longer shifts. Addressed in 26c2893. |
| ${display('inline-block')} | ||
|
|
||
| :host { | ||
| width: 240px; |
There was a problem hiding this comment.
@copilot why are you setting an explicit width here? Most of the nimble-components do not do this, and allow themselves to fit the width of the parent they are placed within. Providing a min-width may make sense (I think I would do 3 times the width of the thumb, such that the thumb could have 3 discrete values to snap to where the thumb visual wouldn't overlap itself at any of the steps.
There was a problem hiding this comment.
@copilot This applies to the height when oriented vertically.
There was a problem hiding this comment.
The 240px width came from the initial standalone presentation and was not a component requirement. I replaced it with parent-responsive width: 100% and a 42px minimum (three 14px thumb widths), while keeping vertical cross-axis sizing independent. Addressed in 10dd851.
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
|
@copilot Let's make one other adjustment: make the fill color for the track from the minimum to the thumb the same as the highlight of the thumb when pressed. |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
Updated the selected track segment to share the pressed thumb’s theme-specific highlight color, while preserving the disabled override. Addressed in 0d040d0. |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>
|
@copilot let's make a slight adjustment and show the min and max values either during hover or while the slider is being operated (clicked). |
Co-authored-by: atmgrifter00 <26874831+atmgrifter00@users.noreply.github.com>





Pull Request
🤨 Rationale
Add a Nimble-styled OK slider backed by the FAST Foundation slider.
👩💻 Implementation
ok-basic-sliderunderok-components/src/basic.🧪 Testing
✅ Checklist