Reputation: 275
I would like to set the custom icon for the slider like in the above image.
Upvotes: 5
Views: 8547
Reputation: 61
I was able to change it with simple css using the class from the MUI documentation:
.MuiSlider-thumb {
background-image: url("./Images/arrow.svg");
}
Upvotes: 2
Reputation:
You can use AirbnbSlider
where you can set the ThumbComponent
to change the icon.
https://material-ui.com/components/slider/#discrete-sliders
function AirbnbThumbComponent(props) {
return (
<span {...props}>
<span className="bar" />
<span className="bar" />
<span className="bar" />
</span>
);
}
...
...
<AirbnbSlider
ThumbComponent={AirbnbThumbComponent}
defaultValue={[20]}
/>
Upvotes: 7