Slider with different thumbs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Summary
I would like to be able to pass different values to the 'slots.thumb' prop to better visually communicate the semantic meaning of each, changing the type of that prop to Array<ElementType> | ElementType, where a non-array is immediately converted to an array of length 1. The thumb elements are picked in the same order presented. If value is shorter (same non-array equivalence to array of length 1), you don't get the thumb elements later in the array; if value is longer it wraps back around, such that the the thumb element for the value at index i is in all cases props.slots.thumbs[i % props.slots.thumb.length].
See also this fixed issue regarding different aria labels on slider thumbs.
Examples
A temperature scale where the "freezing point" thumb indicates a cubic crystal and the "melting point" thumb shows a puddle
Ceiling/floor estimates
Hard-stop limits contrasted from a thumb indicating a target value
Motivation
No response
Search keywords: slider thumbs different
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Slider component and inspect the existing slots.thumb handling and value-to-thumb behavior. Implement support for one or multiple thumb element types with the specified ordering and wrapping rules, then verify that shorter and longer value arrays select the documented thumbs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100