import * as React from 'react';
import { Slider, Box } from '@mui/material';
import { alpha, styled } from '@mui/material/styles';
import GlobalStyles from '@mui/material/GlobalStyles';
const SuccessSlider = styled(Slider)(({ theme }) => ({
width: 250,
color: theme.palette.error.main,
'& .MuiSlider-thumb': {import * as React from 'react';
import { Slider, Box } from '@mui/material';
import { alpha, styled } from '@mui/material/styles';
import GlobalStyles from '@mui/material/GlobalStyles';
const SuccessSlider = styled(Slider)(({ theme }) => ({
width: 250,
color: theme.palette.error.main,
'& .MuiSlider-thumb': {
'&:hover, &.Mui-focusVisible': {
boxShadow:
`0px 0px 0px 8px ${alpha(theme.palette.error.main, 0.16)}`,
},
'&.Mui-active': {
boxShadow:
`0px 0px 0px 14px ${alpha(theme.palette.success.main, 0.16)}`,
color: theme.palette.success.main
},
},
}));
const Example = () => {
return (
<Box sx={{
boxShadow: 2,
margin: '50px',
width: '350px',
textAlign: 'center'
}}>
<GlobalStyles styles={{ h1: { color: 'purple' } }} />
<h1>This is a Slider</h1>
<SuccessSlider defaultValue={30}
valueLabelDisplay='on'
sx={{ margin: '20px' }} />
</Box>
)
}
export default Example;
'&:hover, &.Mui-focusVisible': {
boxShadow:
`0px 0px 0px 8px ${alpha(theme.palette.error.main, 0.16)}`,
},
'&.Mui-active': {
boxShadow:
`0px 0px 0px 14px ${alpha(theme.palette.success.main, 0.16)}`,
color: theme.palette.success.main
},
},
}));
const Example = () => {
return (
<Box sx={{ boxShadow: 2,
margin: '50px',
width: '350px',
textAlign: 'center' }}>
<GlobalStyles styles={{ h1: { color: 'purple' } }} />
<h1>This is a Slider</h1>
<SuccessSlider defaultValue={30}
valueLabelDisplay='on'
sx={{ margin: '20px' }} />
</Box>
)
}
export default Example;