mui / mui/material-ui

Slider with different thumbs

Open
#46,095 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

has workaround scope: slider
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.