Skip to main content
PolyUI/docs

Progress

A linear progress indicator for displaying task completion percentage. Supports static values, labeled steps, and dynamic updates.

Installation

bash
npx polyui add progress

Basic

x
x
x
x
tsx
import { Progress } from "@polyui/react/progress"
export function ProgressBasic() {
  return (
    <div className="flex flex-col gap-4 w-full max-w-sm">
      <Progress value={25} />
      <Progress value={50} />
      <Progress value={75} />
      <Progress value={100} />
    </div>
  )
}

Different Values

x
x
x
x
x
tsx
import { Progress } from "@polyui/react/progress"
export function ProgressDifferentValues() {
  return (
    <div className="flex flex-col gap-4 w-full max-w-sm">
      <Progress value={0} />
      <Progress value={25} />
      <Progress value={50} />
      <Progress value={75} />
      <Progress value={100} />
    </div>
  )
}

With Label

Step 1100%
x
Step 260%
x
Step 320%
x
tsx
import { Progress } from "@polyui/react/progress"
export function ProgressWithLabel() {
  const steps = [
    { label: "Step 1", value: 100 },
    { label: "Step 2", value: 60 },
    { label: "Step 3", value: 20 },
  ]

  return (
    <div className="flex flex-col gap-5 w-full max-w-sm">
      {steps.map((step) => (
        <div key={step.label}>
          <div className="flex justify-between mb-1.5 text-sm">
            <span>{step.label}</span>
            <span className="text-muted-foreground">{step.value}%</span>
          </div>
          <Progress value={step.value} />
        </div>
      ))}
    </div>
  )
}

Props

属性类型默认值说明
valuenumber0Current progress value, between 0 and max.
maxnumber100Maximum progress value. Defaults to 100.
classNamestringAdditional CSS class names.