forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/mui/material-ui/issues/38682
- Loading branch information
Showing
4 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
docs/data/joy/components/circular-progress/CircularProgressCountUp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Box from '@mui/joy/Box'; | ||
import Button from '@mui/joy/Button'; | ||
import CircularProgress from '@mui/joy/CircularProgress'; | ||
import Stack from '@mui/joy/Stack'; | ||
import Typography from '@mui/joy/Typography'; | ||
import * as React from 'react'; | ||
import { useCountUp } from 'use-count-up'; | ||
|
||
export default function CircularProgressDeterminate() { | ||
const [isLoading, setIsLoading] = React.useState(false); | ||
|
||
const { value: value1 } = useCountUp({ | ||
isCounting: isLoading, | ||
duration: 1, | ||
start: 0, | ||
end: 25, | ||
}); | ||
|
||
const { value: value2, reset } = useCountUp({ | ||
isCounting: true, | ||
duration: 1, | ||
start: 0, | ||
end: 75, | ||
}); | ||
|
||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap' }}> | ||
<Stack sx={{ gap: 2 }}> | ||
<CircularProgress size="lg" determinate value={value1}> | ||
<Typography>{value1}%</Typography> | ||
</CircularProgress> | ||
<Button size="sm" onClick={() => setIsLoading(true)}> | ||
Start | ||
</Button> | ||
</Stack> | ||
<Stack sx={{ gap: 2 }}> | ||
<CircularProgress size="lg" determinate value={value2}> | ||
<Typography>{value2}%</Typography> | ||
</CircularProgress> | ||
<Button size="sm" onClick={reset}> | ||
Reset | ||
</Button> | ||
</Stack> | ||
</Box> | ||
); | ||
} |
46 changes: 46 additions & 0 deletions
46
docs/data/joy/components/circular-progress/CircularProgressCountUp.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Box from '@mui/joy/Box'; | ||
import Button from '@mui/joy/Button'; | ||
import CircularProgress from '@mui/joy/CircularProgress'; | ||
import Stack from '@mui/joy/Stack'; | ||
import Typography from '@mui/joy/Typography'; | ||
import * as React from 'react'; | ||
import { useCountUp } from 'use-count-up'; | ||
|
||
export default function CircularProgressDeterminate() { | ||
const [isLoading, setIsLoading] = React.useState(false); | ||
|
||
const { value: value1 } = useCountUp({ | ||
isCounting: isLoading, | ||
duration: 1, | ||
start: 0, | ||
end: 25, | ||
}); | ||
|
||
const { value: value2, reset } = useCountUp({ | ||
isCounting: true, | ||
duration: 1, | ||
start: 0, | ||
end: 75, | ||
}); | ||
|
||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap' }}> | ||
<Stack sx={{ gap: 2 }}> | ||
<CircularProgress size="lg" determinate value={value1}> | ||
<Typography>{value1}%</Typography> | ||
</CircularProgress> | ||
<Button size="sm" onClick={() => setIsLoading(true)}> | ||
Start | ||
</Button> | ||
</Stack> | ||
<Stack sx={{ gap: 2 }}> | ||
<CircularProgress size="lg" determinate value={value2}> | ||
<Typography>{value2}%</Typography> | ||
</CircularProgress> | ||
<Button size="sm" onClick={reset}> | ||
Reset | ||
</Button> | ||
</Stack> | ||
</Box> | ||
); | ||
} |
6 changes: 6 additions & 0 deletions
6
docs/data/joy/components/circular-progress/CircularProgressCountUp.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<CircularProgress size="lg" determinate value={value1}> | ||
<Typography>{value1}%</Typography> | ||
</CircularProgress> | ||
<CircularProgress size="lg" determinate value={value2}> | ||
<Typography>{value2}%</Typography> | ||
</CircularProgress> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters