Skip to content
All components
Feedback

Progress circle

Show how much of a task or quota is complete as a ring or half ring, with the value in the middle.

Determinate progress as a ring or half ring, with its value in the middle.

Installation

tdpxl is not an npm dependency of your app. The @tdpxl/cli command (not published to npm yet) copies the source into your project, with the registry items and npm packages it imports.

npx @tdpxl/cli add progress-circle

Then import it from @/components/ui/progress-circle. New project? Start with the installation guide.

Examples

Each example is one branch of the official demo, rendered in its own frame. The code is that branch as you would write it, with imports pointing at the default install paths.

Adjustable

Update a named progress ring and its visible value together. The caption also names the progress bar. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import * as React from "react"

import { Button } from "@/components/ui/button"
import { ProgressCircle } from "@/components/ui/progress-circle"

export function ProgressCircleAdjustable() {
  const [value, setValue] = React.useState(40)

  return (
    <div className="flex w-full max-w-md flex-col gap-8">
      <div className="flex flex-wrap items-center gap-6">
        <ProgressCircle value={value} label="Profile complete" />
        <div className="flex gap-2">
          <Button size="xs" intent="neutral" emphasis="stroke" onClick={() => setValue((current) => Math.max(0, current - 20))}>
            -20
          </Button>
          <Button size="xs" intent="neutral" emphasis="stroke" onClick={() => setValue((current) => Math.min(100, current + 20))}>
            +20
          </Button>
        </div>
      </div>
    </div>
  )
}

Sizes

Compare the four progress circle sizes. The extra-small size keeps the caption for screen readers only. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import * as React from "react"

import { ProgressCircle } from "@/components/ui/progress-circle"

export function ProgressCircleSizes() {
  const [value, setValue] = React.useState(40)

  return (
    <div className="flex w-full max-w-md flex-col gap-8">
      <div className="flex flex-wrap items-end gap-6">
        <ProgressCircle size="xs" value={60} label="Extra small" />
        <ProgressCircle size="sm" value={60} label="Small" />
        <ProgressCircle size="md" value={60} label="Medium" />
        <ProgressCircle size="lg" value={60} label="Large" />
      </div>
    </div>
  )
}

Half circle

Show progress as a half ring for gauges and quotas. The arc fills from the start side and mirrors in right-to-left layouts. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import * as React from "react"

import { ProgressCircle } from "@/components/ui/progress-circle"

export function ProgressCircleHalfCircle() {
  const [value, setValue] = React.useState(40)

  return (
    <div className="flex w-full max-w-md flex-col gap-8">
      <div className="flex flex-wrap items-end gap-6">
        <ProgressCircle shape="half" size="sm" value={72} label="Uptime" />
        <ProgressCircle shape="half" size="md" value={35} label="Quota" />
      </div>
    </div>
  )
}

Custom units

Announce the same units that are shown. getValueLabel formats both the visible value and aria-valuetext; an external heading names the ring by ID, so the caption only adds the total that aria-valuemax also exposes. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import * as React from "react"

import { ProgressCircle } from "@/components/ui/progress-circle"

export function ProgressCircleCustomUnits() {
  const [value, setValue] = React.useState(40)

  return (
    <div className="flex w-full max-w-md flex-col gap-8">
      <div className="flex flex-col gap-2">
        <p id="progress-circle-demo-storage" className="text-label-sm text-strong-950">
          Storage used
        </p>
        <ProgressCircle
          value={7.5}
          max={10}
          size="md"
          aria-labelledby="progress-circle-demo-storage"
          label="of 10 GB"
          getValueLabel={(current) => `${current} GB`}
        />
      </div>
    </div>
  )
}

Unknown and complete

Compare an unknown value with a complete one. Unknown progress shows an empty ring and announces no invented percentage. Preserves the complete example's required parts, labels and providers. The example's local state remains owned by that composition.

"use client"

import * as React from "react"

import { ProgressCircle } from "@/components/ui/progress-circle"

export function ProgressCircleUnknownAndComplete() {
  const [value, setValue] = React.useState(40)

  return (
    <div className="flex w-full max-w-md flex-col gap-8">
      <div className="flex flex-wrap items-center gap-6">
        <ProgressCircle value={null} label="Waiting to start" />
        <ProgressCircle value={100} label="Complete" />
      </div>
    </div>
  )
}

API reference

Generated from the component's TypeScript signatures. Inherited DOM and primitive props are listed separately.

ProgressCircle

Show determinate progress as a ring or a half ring with its value in the middle. Exposed as role="progressbar"; give it label, aria-label or aria-labelledby.

ProgressCircle props
PropTypeDefaultDescription
inputMode"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined—Hints at the type of data that might be entered by the user while editing the element or its contents
aria-describedbystring | undefined—Identifies the element (or elements) that describes the object.
aria-invalidboolean | "false" | "true" | "grammar" | "spelling" | undefined—Indicates the entered value does not conform to the format expected by the application.
aria-labelstring | undefined—Defines a string value that labels the current element.
aria-labelledbystring | undefined—Identifies the element (or elements) that labels the current element.
valuenumber | null | undefined—Current progress from 0 to max. null, undefined or an out-of-range value means unknown: the ring stays empty and no value is announced.
maxnumber | undefined—Upper bound of value. Defaults to 100; values that are not positive numbers fall back to 100.
size"xs" | "sm" | "md" | "lg" | null | undefined"sm"Overall size. xs hides the caption visually; the value stays visible.
shape"circle" | "half" | null | undefined"circle"circle draws a full ring that starts at the top; half draws an arc that fills from the start side.
labelstring | undefined—Short caption under the value, such as "Storage used". It also names the progress bar when aria-label and aria-labelledby are absent.
showValueboolean | undefinedtrueShow the formatted value in the middle. Turn it off only when the value is shown elsewhere.
getValueLabel((value: number, max: number) => string) | undefined(current, maximum) => `${Math.round((current / maximum) * 100)}%`Format the value for both the visible text and aria-valuetext, so both say the same thing. Defaults to a rounded percentage.
Inherited props (13)
ProgressCircle inherited props
PropTypeDefaultDescription
classNamestring | undefined—Additional classes for this part. Preserve contrast, visible focus and responsive content when adapting styles.
refReact.Ref<HTMLDivElement> | undefined—Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
defaultCheckedboolean | undefined—Initial checked state for a control supporting uncontrolled selection. Inherited DOM typing does not give a layout wrapper checkbox behavior.
defaultValuestring | number | readonly string[] | undefined—Initial value for a control supporting uncontrolled state. Inherited DOM typing alone does not give a layout wrapper input behavior.
autoFocusboolean | undefined—Request automatic focus when the element mounts or the primitive opens, according to its source behavior. Choose initial focus deliberately in context.
idstring | undefined—Stable DOM identifier used by labels, descriptions or other explicit associations.
roleReact.AriaRole | undefined—Semantic role appropriate to the rendered element. Preserve required relationships and keyboard behavior.
onFocusReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native focus event. Preserve the component's existing keyboard and focus behavior.
onBlurReact.FocusEventHandler<HTMLDivElement> | undefined—Receive the native blur event when focus leaves this control.
onChangeReact.ChangeEventHandler<HTMLDivElement, Element> | undefined—Receive the native change event; read the actual control value or checked state from its event target.
onKeyDownReact.KeyboardEventHandler<HTMLDivElement> | undefined—Receive keyboard events. Preserve built-in keyboard behavior unless deliberately implementing an accessible alternative.
onClickReact.MouseEventHandler<HTMLDivElement> | undefined—Receive activation events. The consumer owns the action performed and its result.
onSelectReact.ReactEventHandler<HTMLDivElement> | undefined—Handle the selection event defined by this part's source signature. DOM text-selection events differ from menu or command activation callbacks.

Accessibility & usage

From registry/ui/progress-circle.meta.json (authored guidance; human review may still be pending). Behavior is checked by Storybook tests, not certified here.

When to use

  • Dashboards and cards where a compact percentage or quota needs to stand out.
  • Profile or setup completeness shown as a single number.
  • Gauges such as uptime or storage where a half ring reads naturally.

When not to use

  • Waits of unknown length; use a spinner.
  • Long horizontal layouts or file lists; a progress bar is easier to scan.
  • Comparing several quantities; use a chart.

Anatomy

ProgressCircle
role=progressbar root with value, max, size, shape (circle or half), label, showValue and getValueLabel.
Track and indicator arcs
Decorative SVG; the indicator length is value/max.
Value and caption
Visible text, hidden from assistive technology because the progressbar already exposes them.

Keyboard & interaction

  • Not focusable and not operable; it reports state only.
  • aria-valuenow, aria-valuemax and aria-valuetext follow value, max and getValueLabel; data-state is loading, complete or indeterminate.
  • The arc animates between values and stops animating under prefers-reduced-motion.
  • It does not announce changes by itself; announce milestones with a status message if people need to hear them.

Responsive behavior

  • Sizes are fixed; pick a smaller size in dense layouts rather than scaling text down.
  • Captions wrap within the ring; keep them to one or two words.
  • At xs the caption is visually hidden but still names the progress bar.

Content guidelines

  • Caption what is measured: 'Storage used', 'Profile complete'.
  • Show the most useful unit: percent for tasks, amounts for quotas ('7.5 of 10 GB').
  • When complete, follow with a clear outcome and the next step.

Alternatives

  • Progress — A linear bar for uploads, steps and lists.
  • Spinner — Indeterminate work of unknown duration.
  • Chart — Comparing quantities rather than completion.

Resources