Skip to Content

ProgressBar

Animated horizontal progress bar with easing, checkpoints, and pause/resume control.

Props

PropTypeDefaultDescription
durationnumber5000Full animation duration in milliseconds
trackColorstring#e5e7ebBackground track color
fillColorstring#3b82f6Progress fill color
borderRadiusstring | number9999Border radius of the bar
autoStartbooleantrueStart animation automatically on mount
animationEasingType'linear'Easing curve ('linear', 'easeIn', 'easeOut', 'easeInOut')
checkpointsProgressBarCheckpoint[][]Checkpoints that fire callbacks or pause the animation
onCheckpoint(percentage: number) => voidCalled when a checkpoint is reached
onProgress(percentage: number) => voidCalled on every whole-number progress change (0—100)
onComplete() => voidCalled when progress reaches 100%
classNamestringContainer className
fillClassNamestringFill bar className
fillStyleCSSPropertiesFill bar style overrides
styleCSSPropertiesContainer style
childrenReactNodeContent rendered inside the container (e.g. a label overlay)

ProgressBarCheckpoint

PropertyTypeDescription
atnumberPercentage (0—100) at which this checkpoint fires
pausebooleanIf true, the progress bar pauses at this checkpoint until resumed

Ref Handle

MethodDescription
start()Start the animation from the beginning
pause()Pause the animation
resume()Resume after a pause
reset()Reset to 0 without starting

Example

import { useRef } from 'react' import { ProgressBar, type ProgressBarHandle } from '@appfunnel-dev/sdk/elements' export default function LoadingPage() { const barRef = useRef<ProgressBarHandle>(null) return ( <ProgressBar ref={barRef} duration={3000} fillColor="#2FAD39" animation="easeOut" checkpoints={[{ at: 50, pause: true }]} onCheckpoint={(pct) => console.log(`Reached ${pct}%`)} onComplete={() => console.log('Done!')} /> ) }
Last updated on