Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
holoviz
GitHub Repository: holoviz/panel
Path: blob/main/examples/how_to/custom/react/mui_slider.js
2012 views
1
import Box from '@mui/material/[email protected]';
2
import Slider from '@mui/material/[email protected]';
3
4
function DiscreteSlider({ model }) {
5
const [value, setValue] = model.useState("value")
6
const [marks] = model.useState("marks")
7
return (
8
<Box sx={{ width: 300 }}>
9
<Slider
10
aria-label="Restricted values"
11
defaultValue={value}
12
marks={marks}
13
step={null}
14
valueLabelDisplay="auto"
15
/>
16
</Box>
17
);
18
}
19
20
export default { render: DiscreteSlider }
21
22