Progress Indicator
A determinate progress bar in the accent color.
"use client"
import * as React from "react"
import { Progress } from "@/components/ui/progress"
export default function ProgressDemo() {
const [value, setValue] = React.useState(12)
React.useEffect(() => {
const timer = setInterval(() => setValue((v) => (v >= 100 ? 0 : v + 4)), 300)
return () => clearInterval(timer)
}, [])
return (
<div className="flex w-full max-w-72 flex-col gap-2">
<span className="text-mac-body">Copying “Photos Library”…</span>
<Progress value={value} aria-label="Copy progress" />
<span className="text-mac-subheadline text-mac-label-secondary tabular-nums">
{Math.round(value * 1.4)} MB of 140 MB
</span>
</div>
)
}Installation
pnpm dlx shadcn@latest add @cupertinoui/progressThe first install also adds the macOS theme. See Installation to set up the registry.
Usage
import { Progress } from "@/components/ui/progress"
<Progress value={42} />API Reference
Every part forwards the props of the underlying Base UI Progress part. The props below are the ones CupertinoUI adds or changes.
Progress
| Prop | Type | Description |
|---|---|---|
value | number | Progress from 0 to 100. |
className | string | Extra classes, merged with the component's own. |