Get Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Card
- Checkbox
- Collapsible
- Combobox
- Context Menu
- Date Picker (Lite)
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP (Lite)
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- 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 default function ProgressDemo() {
return <Progress value={66} class="w-[60%]" />
}Installation
pnpm dlx shadcnui-hono-jsx@latest add progressnpx shadcnui-hono-jsx@latest add progressyarn dlx shadcnui-hono-jsx@latest add progressbunx shadcnui-hono-jsx@latest add progressUsage
import { Progress } from "@/components/ui/progress"<Progress value={33} />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} class="w-full max-w-sm">
<ProgressLabel>Upload progress</ProgressLabel>
<ProgressValue />
</Progress>Progress
├── ProgressLabel
├── ProgressValue
└── ProgressTrack
└── ProgressIndicatorLabel
Use ProgressLabel and ProgressValue to add a label and value display.
Upload progress56%
x
import {
Progress,
ProgressLabel,
ProgressValue,
} from "@/components/ui/progress"
export function ProgressWithLabel() {
return (
<Progress value={56} class="w-full max-w-sm">
<ProgressLabel>Upload progress</ProgressLabel>
<ProgressValue />
</Progress>
)
}Controlled
A progress bar that can be controlled by a slider.
x
import { Progress } from "@/components/ui/progress"
import { Slider } from "@/components/ui/slider"
export function ProgressControlled() {
const value = 50
return (
<div class="flex w-full max-w-sm flex-col gap-4">
<Progress value={value} class="w-full" />
<Slider defaultValue={value} min={0} max={100} step={1} />
</div>
)
}RTL
To enable RTL support in shadcn/ui, see the RTL configuration guide.
Upload progress56%
x
تقدم الرفع٥٦%
x
התקדמות העלאה56%
x
// This example sets dir and uses useTranslation because this site is not RTL.
// In an RTL app you won't need them; see the RTL guide.
import {
type Translations,
useTranslation,
} from "@/components/language-selector"
import { Progress, ProgressLabel } from "@/components/ui/progress"
const translations: Translations = {
en: {
dir: "ltr",
values: {
label: "Upload progress",
},
},
ar: {
dir: "rtl",
values: {
label: "تقدم الرفع",
},
},
he: {
dir: "rtl",
values: {
label: "התקדמות העלאה",
},
},
}
function toArabicNumerals(num: number): string {
const arabicNumerals = ["٠", "١", "٢", "٣", "٤", "٥", "٦", "٧", "٨", "٩"]
return num
.toString()
.split("")
.map((digit) => arabicNumerals[parseInt(digit, 10)])
.join("")
}
export function ProgressRtl() {
const { dir, t, language } = useTranslation(translations, "ar")
const formatNumber = (num: number): string => {
if (language === "ar") {
return toArabicNumerals(num)
}
return num.toString()
}
const value = 56
return (
<Progress value={value} class="w-full max-w-sm" dir={dir}>
<ProgressLabel>{t.label}</ProgressLabel>
{/* ProgressValue takes no render function: format the value in place. */}
<span
aria-hidden="true"
class="ms-auto text-sm text-muted-foreground tabular-nums"
>
{formatNumber(value)}%
</span>
</Progress>
)
}Notes
- Server-rendered: the progressbar is not linked to
ProgressLabel(Base UI links them on the client); passaria-labeloraria-labelledby. Function children ofProgressValueare not supported. - Accepts
classinstead ofclassName. - Upstream documentation: shadcn/ui Progress. See also Differences from shadcn/ui.
API Reference
See the Base UI Progress documentation.