Description
Use a ProgressIndicator whenever the user has to wait for more than 150ms. This component is also known as:
- Indicator (Activity-Indicator)
- Loader (Pre-loader)
- Spinner
Demos
Default ProgressIndicator is Circular
<ProgressIndicator />
Default Circular ProgressIndicator
<ProgressIndicatortype="circular"/>
Circular ProgressIndicator with a label in a horizontal direction
Vennligst vent ...
<ProgressIndicator// label="Custom label ..."type="circular"show_label="true"label_direction="horizontal"/>
Circular ProgressIndicator with a label in a vertical direction
Vennligst vent ...
<ProgressIndicator// label="Custom label ..."type="circular"show_label="true"label_direction="vertical"/>
Shows a large Circular ProgressIndicator with a static 50% in progress
<ProgressIndicatortype="circular"progress="50"size="large"no_animation/>
Circular ProgressIndicator with random value
Vennligst vent ...
const ChangeValue = () => {const [value, setValue] = React.useState(50)return (<FormRow centered><ProgressIndicatortype="circular"progress={value}show_labelno_animation/><Buttonleftsize="small"variant="secondary"onClick={() => setValue(Math.random()*100)}>Change</Button></FormRow>)}render(<ChangeValue />)
Circular 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 (<ProgressIndicatortype="circular"size="large"progress={progress}/>)}
on_complete
callback
Circular ProgressIndicator with random () => {const random = (min, max) => (Math.floor( Math.random () * (max - min + 1)) + min)const [visible, setVisible] = React.useState(true)React.useEffect(() => {const timer = setInterval(() => setVisible(!visible), random(2400, 4200))return () => clearTimeout(timer)})return (<ProgressIndicatortype="circular"size="large"visible={visible}on_complete={() => {console.log('on_complete_circular')}}/>)}
Circular ProgressIndicator inside a Modal
<Modalspacing={false}max_width="12rem"fullscreen={false}align_content="centered"hide_close_buttontrigger_text="Show"prevent_close={false}><ProgressIndicatortype="circular"show_labellabel_direction="vertical"top="large"bottom="large"size="large"/></Modal>
Default Linear ProgressIndicator
<ProgressIndicatortype="linear"/>
Small Linear ProgressIndicator
<ProgressIndicatortype="linear"size="small"/>
Linear ProgressIndicator with a label in a horizontal direction
Vennligst vent ...
<ProgressIndicatortype="linear"// label="Custom label ..."show_label="true"label_direction="horizontal"/>
Linear ProgressIndicator with a label in a vertical direction
Vennligst vent ...
<ProgressIndicatortype="linear"// label="Custom label ..."show_label="true"label_direction="vertical"/>
Shows a large Linear ProgressIndicator with a static 50% in progress
<ProgressIndicatortype="linear"progress="50"size="large"no_animation/>
Linear ProgressIndicator with random value
const ChangeValue = () => {const [value, setValue] = React.useState(50)return (<FormRow centered><ProgressIndicatortype="linear"progress={value}no_animation/><Buttonleftsize="small"variant="secondary"onClick={() => setValue(Math.random()*100)}>Change</Button></FormRow>)}render(<ChangeValue />)
Linear 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 (<ProgressIndicatortype="linear"progress={progress}/>)}
on_complete
callback
Linear ProgressIndicator with random () => {const random = (min, max) => (Math.floor( Math.random () * (max - min + 1)) + min)const [visible, setVisible] = React.useState(true)React.useEffect(() => {const timer = setInterval(() => setVisible(!visible), random(2400, 4200))return () => clearTimeout(timer)})return (<ProgressIndicatortype="linear"size="large"visible={visible}on_complete={() => {console.log('on_complete_linear')}}/>)}
Linear ProgressIndicator inside a Modal
<Modalspacing={false}max_width="12rem"fullscreen={false}align_content="centered"hide_close_buttontrigger_text="Show"prevent_close={false}><ProgressIndicatortype="linear"show_labellabel_direction="vertical"top="large"bottom="large"/></Modal>