Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
63 lines
1.5 KiB
JavaScript
63 lines
1.5 KiB
JavaScript
import Box from '@mui/joy/Box';
|
|
import Slider from '@mui/joy/Slider';
|
|
import JoyUsageDemo from 'docs/src/modules/components/JoyUsageDemo';
|
|
|
|
export default function SliderUsage() {
|
|
return (
|
|
<JoyUsageDemo
|
|
componentName="Slider"
|
|
data={[
|
|
{
|
|
propName: 'variant',
|
|
knob: 'radio',
|
|
defaultValue: 'solid',
|
|
options: ['plain', 'outlined', 'soft', 'solid'],
|
|
},
|
|
{
|
|
propName: 'color',
|
|
knob: 'color',
|
|
defaultValue: 'primary',
|
|
},
|
|
{
|
|
propName: 'size',
|
|
knob: 'radio',
|
|
options: ['sm', 'md', 'lg'],
|
|
defaultValue: 'md',
|
|
},
|
|
{
|
|
propName: 'orientation',
|
|
knob: 'radio',
|
|
options: ['horizontal', 'vertical'],
|
|
defaultValue: 'horizontal',
|
|
},
|
|
{
|
|
propName: 'valueLabelDisplay',
|
|
knob: 'radio',
|
|
options: ['off', 'on', 'auto'],
|
|
defaultValue: 'off',
|
|
},
|
|
{ propName: 'disabled', knob: 'switch' },
|
|
{ propName: 'marks', knob: 'switch' },
|
|
]}
|
|
renderDemo={(props) => (
|
|
<Box
|
|
sx={[
|
|
{
|
|
p: 2,
|
|
lineHeight: 0,
|
|
borderRadius: 'sm',
|
|
},
|
|
props.orientation === 'horizontal' && {
|
|
width: 240,
|
|
maxWidth: '100%',
|
|
},
|
|
props.orientation === 'vertical' && { height: 200 },
|
|
]}
|
|
>
|
|
<Slider defaultValue={3} max={10} {...props} />
|
|
</Box>
|
|
)}
|
|
/>
|
|
);
|
|
}
|