Sample Code
"use client";
import React from 'react';
import Box from '@mui/material/Box';
import { styled } from '@mui/material/styles';
import { SliderValueLabelProps } from '@mui/material/Slider';
import {SliderThumb} from '@mui/material/Slider';
const CustomSlider = styled(Slider)(({ theme }) => ({
'& .MuiSlider-rail': {
height: '9px',
borderRadius: '9px',
opacity: '1',
backgroundColor: theme.palette.grey[200],
},
'& .MuiSlider-thumb': {
borderRadius: '50%',
backgroundColor: () => theme.palette.secondary.main,
width: '23px',
height: '23px',
},
'& .MuiSlider-track': {
height: '9px',
borderRadius: '9px',
},
}));
function AirbnbThumbComponent(props: SliderValueLabelProps) {
const { children, ...other } = props;
return (
<SliderThumb {...other}>
{children}
<Box
sx={{
height: 9,
width: '2px',
backgroundColor: '#fff',
}}
/>
<Box
sx={{
height: '14px',
width: '2px',
backgroundColor: '#fff',
ml: '2px',
}}
/>
<Box
sx={{
height: 9,
width: '2px',
backgroundColor: '#fff',
ml: '2px',
}}
/>
</SliderThumb>
);
}
<CustomRangeSlider
slots={{ thumb: AirbnbThumbComponent }}
getAriaLabel={(index) => (index === 0 ? 'Minimum price' : 'Maximum price')}
defaultValue={[20, 40]}
/>