Skip to content

ProgressBar

Used to display the progress status for a task in a horizontal bar.

import {
useEffect,
useState,
} from 'react';
import { ProgressBar } from '@fintech-sandpit/ui/react';
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 (
<ProgressBar
colorScheme="primary"
value={value}
bordered
/>
);
import { ProgressBar } from '@fintech-sandpit/ui/react';
return (
<ProgressBar defaultValue={null} />
);
NameTypeRequiredDefaultDescription
valuenumber | nullControlled progress value, between 0 and 100 1
defaultValuenumber | nullUncontrolled progress value, between 0 and 100 1
colorSchemeColorSchemeneutralProgress bar color scheme
sizeSizemdProgress bar size
borderedbooleanfalseWhether to show a border
ariaLabelstringAria label for the progress bar
ariaLabelledBystringAria labelled by for the progress bar
  1. If value is null, the progress will be indeterminate, causing the progress bar to spin indefinitely.
type ColorScheme = 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'