Skip to content

Use native range slider for volume - #3653

Merged
goto-bus-stop merged 3 commits into
defaultfrom
native-slider
Nov 18, 2026
Merged

goto-bus-stop merged 3 commits into
defaultfrom
native-slider

Conversation

@goto-bus-stop

@goto-bus-stop goto-bus-stop commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Style an <input type="range"> with CSS. The MUI <Slider /> component ships a lot of JS, in part because it supports more stuff that we don't need (like multiple knobs).

It uses an attr(value %) trick to style the parts left and right of the thumb differently. This works because React updates the value attribute (and not just the property) for controlled sliders. I think it's neat!

Before After
image image

The styling is almost identical.

Two things that would be nice:
- [ ] Make the clickable area as big as mui Slider
- [ ] Different colours left and right of the thumb
@goto-bus-stop
goto-bus-stop merged commit bd21d8f into default Nov 18, 2026
9 checks passed
@goto-bus-stop
goto-bus-stop deleted the native-slider branch November 18, 2026 10:33
@goto-bus-stop goto-bus-stop mentioned this pull request Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant