CircleProgress
Circular progress: the viewBox scales proportionally with size (no longer the fixed 100×100 canvas of the progress component's circle form). Radius, circumference and stroke-dasharray are all computed by pure logic in @lh-ui/share/core/circle-progress (getCircleRadius / getCircleCircumference / getCircleDashArray), with zero visual divergence. Supports gradient colors (color array), custom start angle (startAngle), counter-clockwise (clockwise), stroke linecap (linecap) and text formatting (format).
Basic Usage
<script setup lang="ts">
import { ref } from 'vue'
import { LhCircleProgress } from '@lh-ui/vue3'
// Fully controlled component: emits no events itself; the percentage is driven by external state
const percentage = ref(70)
</script>
<template>
<LhCircleProgress :model-value="percentage" />
</template>Gradient colors
When color is an array (≥2 items), the component renders a single linearGradient inside defs (the id is based on the instance uid, so multiple instances never collide), with both ends aligned to the array endpoints:
<LhCircleProgress :model-value="60" :color="['#2B4C7C', '#D9393B']" />Counter-clockwise and start angle
When clockwise=false the svg adds a scaleX(-1) mirror; startAngle treats the 12 o'clock direction as 0 degrees, with clockwise being positive (0 = top, 90 = 3 o'clock, 180 = bottom, 270 = 9 o'clock):
Custom text and track color
format formats the default text; the default slot overrides the whole text; trackColor passes through the track stroke color (falls back to the --lh-bg-color-disabled token when not passed):
API
CircleProgress Props
| Prop | Description | Type | Default |
|---|---|---|---|
| modelValue | Progress percentage 0-100 (controlled, defaults to 0, auto-clamped when out of range) | number | 0 |
| size | Ring size in px (diameter) | number | 120 |
| strokeWidth | Stroke width in px | number | 6 |
| color | Progress color: a single-color string or a gradient color array (an array of ≥2 items uses both ends as gradient endpoints) | string | string[] | — |
| trackColor | Track color (falls back to the lh-circle-progress-track token when not passed) | string | — |
| clockwise | Clockwise (true by default) | boolean | true |
| startAngle | Start angle (degrees, 0 = 12 o'clock direction, clockwise being positive) | number | 0 |
| showText | Show the default percentage text | boolean | true |
| format | Text formatter (defaults to a rounded percentage sign) | LhCircleProgressFormatter | — |
| linecap | Stroke linecap shape (round by default) | LhCircleProgressLinecap | 'round' |
| label | Accessible name | string | — |
| sx | sx quick-layout props | LhSxProps | — |
CircleProgress Slots
| Slot | Description | Scoped props |
|---|---|---|
| default | Overrides the default percentage text | { percentage: number } |
Accessibility
The root node is role="progressbar" with aria-valuemin=0 / aria-valuemax=100 / aria-valuenow=<clamped percentage>; label serves as the accessible name (recommended, and effectively required, when there is no visible text). The text container has pointer-events: none so it does not interfere with interaction.

