Components
Circular Progress
Circular Progress is used to indicates the progress for determinate and indeterminate processes.
- Determinate progress fill the circular track with color, as the indicator moves from 0 to 360 degrees.
- Indeterminate progress grow and shrink the indicator while moving along the circular track.
Import
import { CircularProgress, CircularProgressLabel } from '@outfitio/outkit';
Usage
Changing the size
You can add size prop to the progressbar to add a custom size.
Changing the thickness
You can add thickness prop to update the thicknessof the progress ring.
The thickness has to be a ratio of the size. Value should be between 0 and 1.
Changing the color
You can add color prop to any progressbar to apply any color that exists in the theme.
Adding label
Chakra exports a CircularProgressLabel to help you add label. Pass this component as children and you'll be able to
render the value
Indeterminate Progress
Setting the progress to indeterminate means you're not able to determine the value upfront, so won't need to pass the
value prop.
Accessibility
ARIA
- Progress has a
roleset toprogressbarto denote that it's a progress bar - Progress has
aria-valuenowset to the percentage completion value passed to the component, to ensure the progress percent is visible to screen readers.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| size | string | 48px | The size of the circular progress in CSS units |
| max | number | 100 | Maximum value defining 100% progress made (must be higher than 'min') |
| min | number | 0 | Minimum value defining 'no progress' (must be lower than 'max') |
| value | number | Current progress (must be between min/max) | |
| isIndeterminate | boolean | Puts the component into 'indeterminate' state; Ignores 'value' prop | |
| thickness | number | 0.2 | The thickness of progress indicator as a ratio of size. Must be between 0 and 1 |
| angle | number | 0 | Angle to rotate progress indicator by |
| capIsRound | boolean | If true, the cap of the progress indicator will be rounded | |
| children | React.ReactNode | The content of the circular progress bar. If passed, the content will be inside and centered in the progress bar | |
| trackColor | string | gray | The color name of the progress track. Use a color key in the theme object |
| color | string | blue | The color of the progress indicator. Use a color key in the theme object |