Skip to content

Commit

Permalink
[joy-ui][docs] Fix LinearProgressWithLabel example (#41194)
Browse files Browse the repository at this point in the history
  • Loading branch information
khgiddon authored Feb 20, 2024
1 parent 0d7bf95 commit 70398b9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 38 deletions.
46 changes: 27 additions & 19 deletions docs/data/joy/components/linear-progress/LinearProgressWithLabel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import LinearProgress from '@mui/joy/LinearProgress';
import Typography from '@mui/joy/Typography';
import Box from '@mui/joy/Box';

export default function LinearProgressWithLabel() {
const [progress, setProgress] = React.useState(0);
Expand All @@ -16,28 +17,35 @@ export default function LinearProgressWithLabel() {
}, []);

return (
<LinearProgress
determinate
variant="outlined"
color="neutral"
size="sm"
thickness={32}
value={progress}
<Box
sx={{
'--LinearProgress-radius': '0px',
'--LinearProgress-progressThickness': '24px',
boxShadow: 'sm',
borderColor: 'neutral.500',
bgcolor: 'white',
width: '100%',
}}
>
<Typography
level="body-xs"
fontWeight="xl"
textColor="common.white"
sx={{ mixBlendMode: 'difference' }}
<LinearProgress
determinate
variant="outlined"
color="neutral"
size="sm"
thickness={32}
value={progress}
sx={{
'--LinearProgress-radius': '0px',
'--LinearProgress-progressThickness': '24px',
boxShadow: 'sm',
borderColor: 'neutral.500',
}}
>
LOADING… {`${Math.round(progress)}%`}
</Typography>
</LinearProgress>
<Typography
level="body-xs"
fontWeight="xl"
textColor="common.white"
sx={{ mixBlendMode: 'difference' }}
>
LOADING… {`${Math.round(progress)}%`}
</Typography>
</LinearProgress>
</Box>
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import LinearProgress from '@mui/joy/LinearProgress';
import Typography from '@mui/joy/Typography';
import Box from '@mui/joy/Box';

export default function LinearProgressWithLabel() {
const [progress, setProgress] = React.useState(0);
Expand All @@ -16,28 +17,35 @@ export default function LinearProgressWithLabel() {
}, []);

return (
<LinearProgress
determinate
variant="outlined"
color="neutral"
size="sm"
thickness={32}
value={progress}
<Box
sx={{
'--LinearProgress-radius': '0px',
'--LinearProgress-progressThickness': '24px',
boxShadow: 'sm',
borderColor: 'neutral.500',
bgcolor: 'white',
width: '100%',
}}
>
<Typography
level="body-xs"
fontWeight="xl"
textColor="common.white"
sx={{ mixBlendMode: 'difference' }}
<LinearProgress
determinate
variant="outlined"
color="neutral"
size="sm"
thickness={32}
value={progress}
sx={{
'--LinearProgress-radius': '0px',
'--LinearProgress-progressThickness': '24px',
boxShadow: 'sm',
borderColor: 'neutral.500',
}}
>
LOADING… {`${Math.round(progress)}%`}
</Typography>
</LinearProgress>
<Typography
level="body-xs"
fontWeight="xl"
textColor="common.white"
sx={{ mixBlendMode: 'difference' }}
>
LOADING… {`${Math.round(progress)}%`}
</Typography>
</LinearProgress>
</Box>
);
}

0 comments on commit 70398b9

Please sign in to comment.