Circular Progress

The CircularProgress component is used to indicate the progress for determinate and indeterminate processes.

chakra ui pro

  • Determinate progress: fills the circular track with color, as the indicator moves from 0 to 360 degrees.
  • Indeterminate progress: grows and shrinks the indicator while moving along the circular track.

Import#

import { CircularProgress, CircularProgressLabel } from "@chakra-ui/react"

Usage#

Editable Example

Changing the size#

You can add size prop to the progress bar to add a custom size.

Editable Example

Changing the thickness#

You can add the thickness prop to update the thickness of the progress ring.

This defines the stroke width of the svg circle.

Editable Example

Changing the color#

You can add color prop to any progress bar to apply any color that exists in the theme.

Editable Example

Adding label#

Chakra exports a CircularProgressLabel to help you add a label. Pass this component as children prop and you'll be able to render the value.

40%
Editable Example

Indeterminate Progress#

Setting the progress to indeterminate means you're not able to determine the value upfront. Pass the isIndeterminate prop to activate this state.

Editable Example

Accessibility#

  • Progress has role set to progressbar to denote that it is a progress bar.
  • Progress has aria-valuenow set to the percentage completion value passed to the component, to ensure the progress percent is visible to screen readers.

Props#

capIsRound

Description

If true, the cap of the progress indicator will be rounded.

Type
boolean

getValueText

Description

A function that returns the desired valueText to use in place of the value

Type
((value: number, percent: number) => string)

isIndeterminate

Description

If true, the progress will be indeterminate and the value prop will be ignored

Type
boolean

max

Description

Maximum value defining 100% progress made (must be higher than 'min')

Type
number

min

Description

Minimum value defining 'no progress' (must be lower than 'max')

Type
number

size

Description

The size of the circular progress in CSS units

Type
string | number

thickness

Description

This defines the stroke width of the svg circle.

Type
string | number

trackColor

Description

The color name of the progress track. Use a color key in the theme object

Type
string

value

Description

Current progress (must be between min/max)

Type
number

valueText

Description

The desired valueText to use in place of the value

Type
string

Proudly made inNigeria by Segun Adebayo