Skip to content

ProgressCircle

Used to display a task’s progress in a circular form.

import {
useEffect,
useState,
} from 'react';
// Import component
import { ProgressCircle } from '@fintech-sandpit/ui/react';
// Import styles (optional)
// Please note that the CSS file contains the styles for both the ProgressBar and ProgressCircle components.
import '@fintech-sandpit/ui/style/components/progress.css';
const [value, setValue] = useState(51);
// Your logic to update the value goes here
// For example, you can use a timer to update the value every second
useEffect(() => {
() => {
const timer = setInterval(() => {
if (value < 100) {
setValue(value + 1);
}
}, 1000);
return () => {
clearInterval(timer);
};
},
[
value,
],
);
return (
<ProgressCircle
colorScheme="primary"
value={value}
bordered
withText
/>
);
NameTypeRequiredDefaultDescription
valuenumber | null—Controlled progress value, between 0 and 100 1
defaultValuenumber | null—Uncontrolled progress value, between 0 and 100 1
colorSchemeColorSchemeneutralProgress bar color scheme
sizeSizemdProgress bar size
boxSizeCssUnit—Progress bar box size 2
thicknessCssUnit—Progress bar thickness 3
withTextbooleanfalseWhether to show a value inside the circle
  1. If value is null, the progress will be indeterminate, causing the progress circle to spin indefinitely.
  2. If provided, the size prop will be ignored.
  3. Makes sense only if box size is provided.
type ColorScheme = 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
type CssUnit = `${number}${'px' | 'em' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax' | '%'}`
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'