Progress
Data DisplayHorizontal progress bar with animated fill.
Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.
"use client";
import { Progress } from "@dashboardpack/core/components/ui/progress";
import { Button } from "@dashboardpack/core/components/ui/button";
import { useState } from "react";
export default function ProgressExample() {
const [value, setValue] = useState(40);
return (
<div className="w-full max-w-sm space-y-4">
<div className="flex justify-between text-sm">
<span>Project completion</span>
<span>{value}%</span>
</div>
<Progress
value={value}
role="progressbar"
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={value}
aria-label="Project completion"
/>
<div className="flex gap-2">
<Button
size="sm"
variant="outline"
onClick={() => setValue(Math.max(0, value - 10))}
>
Decrease
</Button>
<Button size="sm" onClick={() => setValue(Math.min(100, value + 10))}>
Increase
</Button>
</div>
<Progress
value={100}
role="progressbar"
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={100}
aria-label="Completed milestone"
/>
</div>
);
}Usage
Use for a percentage between zero and 100. Values are visually clamped to that range. Supply role=progressbar and aria-valuemin, aria-valuemax, and aria-valuenow explicitly; the component renders a styled div and forwards HTML attributes.
import { Progress } from "@dashboardpack/core/components/ui/progress";Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.
API reference
Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.
| Prop | Type / Default | Description |
|---|---|---|
| value | numberDefault: 0 | Current percentage, visually clamped to 0–100. |
| indicatorClassName | stringDefault: — | Extend the inner indicator styles. |
| className | stringDefault: — | Extend the outer track styles. |
| role / aria-* | HTML div attributesDefault: — | Supply accessible progressbar semantics and values. |