Progress
Ant-shaped line progress with percent, status tones, and an optional percent label.
Progress renders a horizontal percent bar with optional status color and a trailing percent label. It follows Ant Design Progress line semantics (percent + status + info label). Circle, dashboard, and steps variants are out of scope for v1.
When To Use
- Show determinate completion for uploads, indexing jobs, batch ops, or wizard steps with a known percent.
- Prefer status tones (
active/success/exception) when the bar should mirror lifecycle color next to tags or KPIs. - Hide the percent label with
showInfo={false}when the surrounding chrome already shows the figure. - Use a spinner or skeleton instead when progress is indeterminate or you only need a loading affordance.
- Do not use Progress for multi-step wizards that need discrete steps — use Stepper instead.
Features
| Area | Behavior |
|---|---|
| Percent | Clamped and rounded to 0–100; drives track width and aria-valuenow |
| Status | Track tone: normal → primary, active → info, success → success, exception → destructive |
| Info label | Trailing N% by default; omit with showInfo={false} |
| A11y | Rail exposes role="progressbar" with aria-valuemin / max / now |
| Slots | classNames for root, rail, track, and info |
Installing
pnpm dlx shadcn@latest add https://ui.isaacfei.com/r/progress.jsonnpx shadcn@latest add https://ui.isaacfei.com/r/progress.jsonyarn dlx shadcn@latest add https://ui.isaacfei.com/r/progress.jsonbun x shadcn@latest add https://ui.isaacfei.com/r/progress.jsonWith a namespace: npx shadcn@latest add @f-ui/progress.
registryDependencies: shadcn progress (Radix Progress primitive).
Usage
import { Progress } from "@/components/f-ui/progress/progress";
<Progress percent={60} />Examples
Basic
Default line progress with a percent label to the right of the rail.
"use client";
import { Progress } from "@/components/f-ui/progress/progress";
export function ProgressDemo() {
return <Progress percent={60} />;
}Statuses
Four status tones on the track — normal, active, success, and exception.
"use client";
import { Progress } from "@/components/f-ui/progress/progress";
export function ProgressStatusesDemo() {
return (
<div className="flex max-w-md flex-col gap-4">
<Progress percent={30} status="normal" />
<Progress percent={50} status="active" />
<Progress percent={100} status="success" />
<Progress percent={70} status="exception" />
</div>
);
}Hide Info
Omit the trailing percent when the host already shows the value elsewhere.
"use client";
import { Progress } from "@/components/f-ui/progress/progress";
export function ProgressHideInfoDemo() {
return <Progress percent={45} showInfo={false} />;
}Composition
Progress (f-ui)
├── Progress (ui / Radix Root — rail)
│ └── Indicator (fill)
└── info? (percent label)f-ui owns Ant status tones and the trailing percent; the bar itself is the vendored shadcn Progress.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
percent | number | — | Completion value; clamped and rounded to 0–100. |
status | "normal" | "active" | "success" | "exception" | "normal" | Track color tone. |
showInfo | boolean | true | When true, shows the trailing percent label. |
className | string | — | Merged onto the root. |
classNames | Partial<Record<ProgressSlot, string>> | — | Per-slot classes. |
Slots
| Slot | Applied to |
|---|---|
root | Outer flex wrapper |
rail | shadcn Progress root (muted track) |
track | Extra classes on the rail (use [&_[data-slot=progress-indicator]]:… to tint the fill) |
info | Trailing percent label |