Progress
Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
Loading…
"use client"
import * as React from "react"
import { Progress } from "@/components/ui/progress"
export default function ProgressDemo() {
const [progress, setProgress] = React.useState(13)
React.useEffect(() => {
const timer = setTimeout(() => setProgress(66), 500)
return () => clearTimeout(timer)
}, [])
return <Progress value={progress} className="w-[60%]" />
}Installation
pnpm dlx shadcn@latest add @kickresume/progressUsage
import { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue } from "@/components/ui/progress"<Progress value={progress} className="w-[60%]" />Composition
With label and value
Use ProgressLabel and ProgressValue to add a label and value display.
import {
Progress,
ProgressLabel,
ProgressValue,
} from "@/components/ui/progress"
;<Progress value={56} className="w-full max-w-sm">
<ProgressLabel>Upload progress</ProgressLabel>
<ProgressValue />
</Progress>Progress
├── ProgressLabel
├── ProgressValue
└── ProgressTrack
└── ProgressIndicatorExamples
Label
Use ProgressLabel and ProgressValue to add a label and value display.
Loading…
"use client"
import {
Progress,
ProgressLabel,
ProgressValue,
} from "@/components/ui/progress"
export default function ProgressLabelDemo() {
return (
<Progress value={56} className="w-full max-w-sm">
<ProgressLabel>Upload progress</ProgressLabel>
<ProgressValue />
</Progress>
)
}Controlled
A progress bar that can be controlled by a slider.
Loading…
"use client"
import * as React from "react"
import { Progress } from "@/components/ui/progress"
import { Slider } from "@/components/ui/slider"
export default function ProgressControlled() {
const [value, setValue] = React.useState(50)
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<Progress value={value} className="w-full" />
<Slider
value={value}
onValueChange={(value) => setValue(value as number)}
min={0}
max={100}
step={1}
/>
</div>
)
}API Reference
See the Base UI Progress documentation.