Skip to content

Commit d4536b0

Browse files
committed
Wrap LinearProgressWithLabel in Box with bgcolor
1 parent 28fa8cc commit d4536b0

File tree

2 files changed

+54
-38
lines changed

2 files changed

+54
-38
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import LinearProgress from '@mui/joy/LinearProgress';
33
import Typography from '@mui/joy/Typography';
4+
import Box from '@mui/joy/Box';
45

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

1819
return (
19-
<LinearProgress
20-
determinate
21-
variant="outlined"
22-
color="neutral"
23-
size="sm"
24-
thickness={32}
25-
value={progress}
20+
<Box
2621
sx={{
27-
'--LinearProgress-radius': '0px',
28-
'--LinearProgress-progressThickness': '24px',
29-
boxShadow: 'sm',
30-
borderColor: 'neutral.500',
22+
bgcolor: 'white',
23+
width: '100%',
3124
}}
3225
>
33-
<Typography
34-
level="body-xs"
35-
fontWeight="xl"
36-
textColor="common.white"
37-
sx={{ mixBlendMode: 'difference' }}
26+
<LinearProgress
27+
determinate
28+
variant="outlined"
29+
color="neutral"
30+
size="sm"
31+
thickness={32}
32+
value={progress}
33+
sx={{
34+
'--LinearProgress-radius': '0px',
35+
'--LinearProgress-progressThickness': '24px',
36+
boxShadow: 'sm',
37+
borderColor: 'neutral.500',
38+
}}
3839
>
39-
LOADING… {`${Math.round(progress)}%`}
40-
</Typography>
41-
</LinearProgress>
40+
<Typography
41+
level="body-xs"
42+
fontWeight="xl"
43+
textColor="common.white"
44+
sx={{ mixBlendMode: 'difference' }}
45+
>
46+
LOADING… {`${Math.round(progress)}%`}
47+
</Typography>
48+
</LinearProgress>
49+
</Box>
4250
);
4351
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import LinearProgress from '@mui/joy/LinearProgress';
33
import Typography from '@mui/joy/Typography';
4+
import Box from '@mui/joy/Box';
45

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

1819
return (
19-
<LinearProgress
20-
determinate
21-
variant="outlined"
22-
color="neutral"
23-
size="sm"
24-
thickness={32}
25-
value={progress}
20+
<Box
2621
sx={{
27-
'--LinearProgress-radius': '0px',
28-
'--LinearProgress-progressThickness': '24px',
29-
boxShadow: 'sm',
30-
borderColor: 'neutral.500',
22+
bgcolor: 'white',
23+
width: '100%',
3124
}}
3225
>
33-
<Typography
34-
level="body-xs"
35-
fontWeight="xl"
36-
textColor="common.white"
37-
sx={{ mixBlendMode: 'difference' }}
26+
<LinearProgress
27+
determinate
28+
variant="outlined"
29+
color="neutral"
30+
size="sm"
31+
thickness={32}
32+
value={progress}
33+
sx={{
34+
'--LinearProgress-radius': '0px',
35+
'--LinearProgress-progressThickness': '24px',
36+
boxShadow: 'sm',
37+
borderColor: 'neutral.500',
38+
}}
3839
>
39-
LOADING… {`${Math.round(progress)}%`}
40-
</Typography>
41-
</LinearProgress>
40+
<Typography
41+
level="body-xs"
42+
fontWeight="xl"
43+
textColor="common.white"
44+
sx={{ mixBlendMode: 'difference' }}
45+
>
46+
LOADING… {`${Math.round(progress)}%`}
47+
</Typography>
48+
</LinearProgress>
49+
</Box>
4250
);
4351
}

0 commit comments

Comments
 (0)