Progress

A bar or ring showing how far a task has got, or an indeterminate bar while the length is unknown.

Status: beta. Category: Feedback.

import { Progress, ProgressCircle } from '@glyphui/ui'

Exports: Progress, ProgressCircle, progressStyles, progressCircleStyles.

Notes

  • The visible label becomes the accessible name. Without one, pass aria-label.
  • aria-valuetext uses formatValue, so screen readers hear "3 of 5 files" if that is what you show.

Example: Bar with label

import { Button, Progress } from '@glyphui/ui'
import { useState } from 'react'

export default function Example() {
  const [value, setValue] = useState(3)
  return (
    <div className="grid max-w-md gap-4">
      <Progress
        label="Uploading files"
        value={value}
        max={5}
        showValue
        formatValue={(v, max) => `${v} of ${max}`}
      />
      <Button
        size="sm"
        variant="outline"
        className="w-fit"
        onClick={() => setValue((v) => (v >= 5 ? 0 : v + 1))}
      >
        Advance
      </Button>
    </div>
  )
}

Example: Sizes and tones

import { Progress } from '@glyphui/ui'

export default function Example() {
  return (
    <div className="grid max-w-md gap-4">
      <Progress aria-label="Storage" value={32} size="sm" />
      <Progress aria-label="Seats" value={64} tone="success" />
      <Progress aria-label="API quota" value={86} tone="warning" size="lg" />
      <Progress aria-label="Disk" value={97} tone="danger" />
    </div>
  )
}

Example: Ring

ProgressCircle for compact spaces such as table cells and cards.

import { ProgressCircle } from '@glyphui/ui'

export default function Example() {
  return (
    <div className="flex items-center gap-6">
      <ProgressCircle aria-label="Profile complete" value={40} size="sm" />
      <ProgressCircle aria-label="Onboarding" value={68} showValue />
      <ProgressCircle aria-label="Storage used" value={92} tone="warning" size="lg" showValue />
    </div>
  )
}

Example: Indeterminate

Omit value while the total is unknown.

import { Progress } from '@glyphui/ui'

export default function Example() {
  return <Progress label="Preparing export" className="max-w-md" />
}

Live page: https://glyphui.xyz/components/progress