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
| Prop | Description | Type | Options | Default |
|---|---|---|---|---|
| percentage | Progress percentage; automatically clamped to [0, 100] | number | — | 0 |
| type | Shape | 'line' | 'circle' | — | 'line' |
| status | Status; normal automatically becomes success at 100 | 'normal' | 'success' | 'warning' | 'exception' | — | 'normal' |
| color | Progress bar color: a string or a function returning a color by percentage | string | ((percentage: number) => string) | — | — |
| strokeWidth | Stroke width in px (height for line, stroke width for circle) | number | — | 6 |
| width | Canvas width in px for circle mode | number | — | 126 |
| showText | Whether to show the text | boolean | — | true |
| format | Custom text content (receives the clamped percentage, returns a ReactNode) | (percentage: number) => ReactNode | — | — |
| sx | Layout shorthand | SxProps | — | — |
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'