mui / mui/base-ui

[slider] Arbitrarily restrict the possible values of the slider

Open
#412 5 comments 3 reactions 0 assignees View on GitHub
component: slider type: new feature waiting for 👍
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

In `@mui/base` the `marks` and `step` props were used together to restrict the possible values of the slider to some arbitrary numbers like this:
```jsx

```
([Here](https://v6.mui.com/base-ui/react-slider/#css-DiscreteSliderValues.tsx) is a full demo from the docs)

However it doesn't make sense to have `marks`, which should be only about the visual marks, dictate the step.

We decided to redesign this feature using the component-per-node API, e.g.:
```jsx







```
- If any `RestrictedValue` component is present, the `step` prop should be ignored
- The `RestrictedValue` component could render a span with some minimal positioning styles

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.