CircularProgress
Ring-shaped progress indicator for uploads, downloads, and goal-completion states.
Renders an ARIA progressbar with min/max/now values; indeterminate state omits the value so assistive tech announces "loading".
import { CircularProgress } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
<CircularProgress value={25} />
<CircularProgress value={50} />
<CircularProgress value={75} />
<CircularProgress value={100} />
</div>
);
}
import { CircularProgress } from '@arshad-shah/cynosure-react';
<CircularProgress value={60} />For custom layouts (overlaid badges, multi-ring visualisations) compose with CircularProgressRoot, CircularProgressTrack, CircularProgressIndicator, and CircularProgressLabel directly.
Five sizes are available: xs, sm, md (default), lg, and xl.
import { CircularProgress } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<div style={{ display: 'flex', gap: '1.25rem', alignItems: 'center' }}>
<CircularProgress value={60} size="xs" />
<CircularProgress value={60} size="sm" />
<CircularProgress value={60} size="md" />
<CircularProgress value={60} size="lg" />
<CircularProgress value={60} size="xl" />
</div>
);
}
Color schemes
Section titled “Color schemes”Pick a scheme that matches the surrounding context: accent, success, warning, danger, or neutral.
import { CircularProgress } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<div style={{ display: 'flex', gap: '1.25rem', alignItems: 'center' }}>
<CircularProgress value={70} colorScheme="accent" />
<CircularProgress value={70} colorScheme="success" />
<CircularProgress value={70} colorScheme="warning" />
<CircularProgress value={70} colorScheme="danger" />
<CircularProgress value={70} colorScheme="neutral" />
</div>
);
}
With label
Section titled “With label”Pass children to render centered content — typically a percentage or a short label.
import { CircularProgress } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<div style={{ display: 'flex', gap: '1.5rem', alignItems: 'center' }}>
<CircularProgress value={42} size="lg">
<span style={{ fontWeight: 600, fontSize: '0.875rem' }}>42%</span>
</CircularProgress>
<CircularProgress value={100} size="lg" colorScheme="success">
<span style={{ fontWeight: 600, fontSize: '0.875rem' }}>Done</span>
</CircularProgress>
</div>
);
}
Indeterminate
Section titled “Indeterminate”Pass indeterminate for an unknown-duration loader. The ARIA value attributes are dropped so assistive tech announces an unspecified loading state.
import { CircularProgress } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<div style={{ display: 'flex', gap: '1.5rem', alignItems: 'center' }}>
<CircularProgress indeterminate size="md" aria-label="Loading" />
<CircularProgress indeterminate size="lg" colorScheme="success" aria-label="Loading" />
</div>
);
}
Accessibility
Section titled “Accessibility”- Renders
role="progressbar"witharia-valuenow,aria-valuemin, andaria-valuemax. - Sets
aria-valuetextto a formatted percentage so screen readers announce a human-readable value. - Omits the value when
indeterminateis set so assistive tech reports “loading” instead. - Provide an
aria-labelwhen the ring is the only feedback on screen. data-completeis exposed on the root oncevalue >= max(unlesscompletionState="none"), letting you style the finished state.
Recipes
Section titled “Recipes”- Use
valuefor deterministic progress (uploads, downloads); passindeterminatefor spinner-style loaders. - Tune
thicknessto make the ring beefier on dark surfaces or thinner inside dense dashboards. - Combine
colorScheme="success"with the defaultcompletionState="auto"for a green finished-state at 100%. - Pair with
Statto render a metric inside the ring’s centre viaCircularProgressLabel.