Getting Started
Components52
- Accordion
- Alert
- Alert Dialog
- Attachment
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Collapsible
- Command
- Context Menu
- Data Table
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Pagination
- Popover
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
x
import { Progress } from "@/components/ui/progress"
export function ProgressDemo() {
return <Progress value={60} aria-label="Upload" className="w-full max-w-xs" />
}Installation#
pnpm dlx shadcn@latest add https://ui.ikramhasan.com/r/progress.json
Usage#
import { Progress } from "@/components/ui/progress"<Progress value={33} />Examples#
With label and value#
Syncing products13%
x
"use client"
import * as React from "react"
import { Button } from "@/components/ui/button"
import { Progress, ProgressLabel, ProgressValue } from "@/components/ui/progress"
export function ProgressWithLabelAndValue() {
const [value, setValue] = React.useState(13)
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<Progress value={value}>
<ProgressLabel>Syncing products</ProgressLabel>
<ProgressValue />
</Progress>
<div className="flex gap-2">
<Button
variant="secondary"
size="sm"
onClick={() => setValue((v) => Math.max(0, v - 20))}
>
−20
</Button>
<Button
variant="secondary"
size="sm"
onClick={() => setValue((v) => Math.min(100, v + 20))}
>
+20
</Button>
</div>
</div>
)
}Empty and complete#
Not started0%
x
Done100%
x
import { Progress, ProgressLabel, ProgressValue } from "@/components/ui/progress"
export function ProgressEmptyAndComplete() {
return (
<div className="flex w-full max-w-xs flex-col gap-4">
<Progress value={0}>
<ProgressLabel>Not started</ProgressLabel>
<ProgressValue />
</Progress>
<Progress value={100}>
<ProgressLabel>Done</ProgressLabel>
<ProgressValue />
</Progress>
</div>
)
}API Reference#
Progress is built on the Base UI Progress primitive. See the Base UI documentation for every prop.