Progress for Astro
Astro progress tracks for a known value or an unknown completion time.
Installation
bunx --bun shadcn@latest add @gnostic/progressnpx shadcn@latest add @gnostic/progresspnpm dlx shadcn@latest add @gnostic/progressCopy the files
src/components/ui/progress/progress.astrosrc/components/ui/progress/progress-value.astrosrc/components/ui/progress/progress-indicator.astrosrc/components/ui/progress/progress-track.astrosrc/components/ui/progress/progress-label.astrosrc/components/ui/progress/index.ts
Usage
import { Progress } from "@/components/ui/progress"
Use the Code tab above for the complete Astro composition.
API reference
Read the registry source for the exported parts and prop types.
When to use Progress
Pass a value between min and max for measured progress. Omit value or pass null for an indeterminate task. The root supplies a default track and indicator; use the exported parts when you need a custom label layout.
Keyboard and behavior
Give the root aria-label or connect it to visible text with aria-labelledby. Values are clamped to the range, and indeterminate progress omits aria-valuenow. The component renders the initial value; live updates must keep the ARIA value and --progress-percentage in step.
Theme and layout
The indicator uses the primary token and the track uses input color. A reduced-motion preference removes its animation. Never invent a percentage when the task cannot report progress.