#Description
Use a ProgressIndicator whenever the user has to wait for more than 150ms. This component is also knows as:
- Indicator (Activity-Indicator)
- Loader (Pre-loader)
- Spinner
#Demos
Default Circular ProgressIndicator
Shows a large Circular ProgressIndicator with a static 50% in progress
<ProgressIndicator
type="circular"
progress="50"
size="large"
no_animation
/>
ProgressIndicator with random progress value to show the transition
() => {
const random = (min, max) => (Math.floor( Math.random () * (max - min + 1)) + min)
const [progress, setProgressIndicator] = React.useState(random(1, 100))
React.useEffect(() => {
const timer = setInterval(() => setProgressIndicator(random(1, 100)), 1e3)
return () => clearInterval(timer)
})
return (
<ProgressIndicator
size="large"
progress={progress}
/>
)
}
ProgressIndicator with random on_complete
callback
() => {
const random = (min, max) => (Math.floor( Math.random () * (max - min + 1)) + min)
const [visible, setVisibe] = React.useState(true)
React.useEffect(() => {
const timer = setInterval(() => setVisibe(!visible), random(2400, 4200))
return () => clearTimeout(timer)
})
return (
<ProgressIndicator
size="large"
visible={visible}
on_complete={() => {
console.log('on_complete')
}}
/>
)
}