Skip to content

    Progress

    A bar, circle or half circle that shows how much of a task is done when the amount is known: an upload, an import, storage used. Each shape is Slider's 12px track, and a bar is a flat rail like it. The accent is the part that is done. The remainder is its own hatched track with a 1px border, 4px away, and there is no stop dot. With no value it shows that work runs without saying how much is left. label names the task, and showValue adds the percentage.

    React

    Preview

    Uploading report.pdf

    Props

    • variant
    • value
    • max
    • size
    • showValue
    • label
    import { Progress } from "@/components/ui/progress"
    
    <div className="w-64 max-w-full">
      <Progress label="Uploading report.pdf" value={40} />
    </div>

    Usage

    When to use

    • Show how much of a task is done when the amount is known: an upload, an import, the files of a sync.
    • A task long enough for the user to wait on, named above the bar.

    When not to use

    • Work whose amount is never known, such as checking a value. Use Spinner.
    • Content whose layout you know while it loads, such as a list. Use Skeleton.
    • The steps of a flow the user moves through, such as a setup wizard.

    Platform support

    What each platform has, from the spec. A selected platform is highlighted.

    NameWebiOSAndroidNote
    variantYesYesYes
    valueYesYesYes
    maxYesYesYes
    sizeYesYesYes
    labelYesYesYes
    showValueYesYesYes

    Variants

    variant

    bar is the track. circle is a full ring. semicircle is the top half, open along the bottom.

    • Uploading report.pdf

      bardefault

    • Uploading report.pdf

      circle

    • Uploading report.pdf

      semicircle

    import { Progress } from "@/components/ui/progress"
    
    <div className="w-64 max-w-full">
      <Progress label="Uploading report.pdf" value={40} />
    </div>
    <Progress label="Uploading report.pdf" value={40} variant="circle" />
    <Progress label="Uploading report.pdf" value={40} variant="semicircle" />

    size

    On a circle or half circle, sm is 80px across and md is 112px. The stroke stays 12px at both, the same as the bar.

    • Uploading report.pdf

      sm

    • Uploading report.pdf

      mddefault

    import { Progress } from "@/components/ui/progress"
    
    <div className="w-64 max-w-full">
      <Progress label="Uploading report.pdf" value={40} size="sm" />
    </div>
    <div className="w-64 max-w-full">
      <Progress label="Uploading report.pdf" value={40} />
    </div>

    Examples

    Upload

    Uploading report.pdf
    import { Progress } from "@/components/ui/progress"
    
    <div className="w-64 max-w-full">
      <Progress label="Uploading report.pdf" value={40} showValue />
    </div>

    A count of files

    max is the real count, so the bar and its percentage follow the files done.

    Importing files
    import { Progress } from "@/components/ui/progress"
    
    <div className="w-64 max-w-full">
      <Progress label="Importing files" value={3} max={12} showValue />
    </div>

    Unknown amount

    No value: the bar shows that work runs, not how much is left.

    Preparing your export
    import { Progress } from "@/components/ui/progress"
    
    <div className="w-64 max-w-full">
      <Progress label="Preparing your export" />
    </div>

    Named elsewhere

    A bar in a card row whose name is already on screen.

    import { Progress } from "@/components/ui/progress"
    
    <div className="w-64 max-w-full">
      <Progress aria-label="Storage sync" value={75} />
    </div>

    Circle

    One share, such as storage used. The percentage sits in the ring.

    import { Progress } from "@/components/ui/progress"
    
    <Progress variant="circle" aria-label="Storage used" value={72} showValue />

    Half circle

    The same ring, open along the bottom. The hatched arc stays 4px from the accent.

    Storage used
    import { Progress } from "@/components/ui/progress"
    
    <Progress variant="semicircle" label="Storage used" value={72} showValue />

    Do and don't

    Do

    • Name the task in the label, and use the real count as max (12 files) when there is one.
    • Show the percentage when the task takes long enough for the user to wait on it.
    • Say in text when a long task is done or has failed; the meter alone is not announced.
    • Use a circle or a half circle for one share in a small space, such as storage used. Use the bar for a task with its name above it.

    Don't

    • Don't use it when the amount is never known. Use Spinner.
    • Don't show one bar per step of a single task; one meter covers the whole task.
    • Don't use it for the steps of a flow the user moves through.
    • Don't let a bar run the full width of a page. Give it a length, about 256px, the same as Slider.

    Props

    NameTypeValuesDefaultDescription
    variantenumbar | circle | semicirclebarbar is the track. circle is a full ring. semicircle is the top half, open along the bottom.
    valuenumber--How much is done, from 0 to max. Leave it out, or pass null, when the amount is unknown: the meter is indeterminate.
    maxnumber-100The value when the task is done. Use the real count (12 files) and pass the count done as value.
    sizeenumsm | mdmdOn a circle or half circle, sm is 80px across and md is 112px. The stroke stays 12px at both, the same as the bar.
    labelnode--The visible name above the meter: what is in progress, Uploading report.pdf. Without it, set aria-label or aria-labelledby.
    showValueboolean-falseShows the percentage: at the end of the label row on a bar, in the middle of a circle, along the bottom of a half circle. Screen readers get it either way.

    Anatomy

    PartDescription
    rootThe meter. A bar is 12px tall and as wide as its parent. A circle is a ring, 80px (sm) or 112px (md) across. A half circle is the top half of that ring. The stroke is 12px, the same as the bar.
    indicatorThe accent track from the start, as long as the share of the work that is done, radius-full. On a circle or half circle it is the accent arc. It stops 4px short of the hatched track. With no value, a third of the meter that pulses, with the hatched track 4px away on both sides.
    trackThe remainder as its own hatched track with a 1px border, radius-full, 4px (spacing-xs) from the accent. At 0% it is the whole meter. At 100% it is absent. On a circle or half circle it is the hatched arc with the same 1px border.
    wrapperWith label, or with showValue on a bar: the column that holds the label row above the track, gap-xs.
    headerThe label row: the label, then on a bar the percentage at the end, gap-sm.
    label14px medium primary text that names the task.
    valueWith showValue: 14px secondary text with tabular figures. On a bar it sits at the end of the label row. On a circle it sits in the middle of the ring. On a half circle it sits along the bottom.

    Accessibility

    Role: progressbar

    • Always named: the label prop (linked with aria-labelledby), or aria-label or aria-labelledby when the name is shown elsewhere. The type requires one.
    • aria-valuenow, aria-valuemin and aria-valuemax follow value and max; aria-valuetext reads the percentage (40%). With no value, the meter is indeterminate and has neither. A circle and a half circle use the same role and values.
    • The visible percentage (showValue) is hidden from screen readers, since they read aria-valuetext on the meter.
    • The fill grows only when the user allows motion, and the indeterminate pulse stops under prefers-reduced-motion.
    • A progress meter is not a live region. For a long task, also say in text when it is done.

    Install

    npx werewolf-ui add progress

    Run npx werewolf-ui init once in your app before adding components. Init sets up tokens, their CSS import and agent rules. Add installs this component and its dependencies while preserving your theme. See Installation for requirements and the alternative registry setup.