Skip to main content

Progress

Displays the completion progress of a task or capacity; supports line and circle shapes with customizable color and text.

Basic usage​

Basic usage
60%
100%
80%
40%
55%
70 pts
75%
100%
30%
import { LhProgress } from '@lh-ui/react'

export default function Demo() {
return (
<>
<LhProgress percentage={60} />
<LhProgress percentage={80} status="warning" />
<LhProgress type="circle" percentage={75} />
</>
)
}

Progress Props​

PropDescriptionTypeOptionsDefault
percentageProgress percentage; automatically clamped to [0, 100]number—0
typeShape'line' | 'circle'—'line'
statusStatus; normal automatically becomes success at 100'normal' | 'success' | 'warning' | 'exception'—'normal'
colorProgress bar color: a string or a function returning a color by percentagestring | ((percentage: number) => string)——
strokeWidthStroke width in px (height for line, stroke width for circle)number—6
widthCanvas width in px for circle modenumber—126
showTextWhether to show the textboolean—true
formatCustom text content (receives the clamped percentage, returns a ReactNode)(percentage: number) => ReactNode——
sxLayout shorthandSxProps——
Vue equivalent

percentage / type / status / color / strokeWidth / width / showText match lh-ui-plus's LhProgress props; React has no slots, so plus's format prop and #text scoped slot are merged into a single format render function (receives the clamped percentage, returns a ReactNode).

Accessibility

The root element carries role="progressbar" with aria-valuemin / aria-valuemax / aria-valuenow, following the WAI-ARIA progressbar pattern; aria-valuetext mirrors the visible text — the percentage by default, or the formatted text when format is passed (falling back to the rounded percentage when format returns a non-string).

Styles​

import '@lh-ui/react/style/progress'