Skip to content
Haze UI

Progress

Horizontal progress bar with a label, an optional percentage and status colors, set from a value and a max.

pnpm dlx shadcn@latest add @haze/progress
Open preview in a new tab
Liveno JavaScript

When to use

  • An upload, import or quota where you know how much is done
  • Showing storage or plan usage, with warning or destructive fill when it runs high
  • A bar whose name is read out even when the label is visually hidden

When not to use

  • Work of unknown length; use spinner
  • Named steps in a flow; use stepper

Installation

Add the Haze registry to components.json once, then install Progress with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/progress
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
value*number–Current amount from 0 to max; values outside the range are clamped.
maxnumber100Amount that counts as complete.
label*string–Names the bar for assistive technology and is printed above it.
hideLabelbooleanfalseHides the printed label; the accessible name stays.
showValuebooleanfalsePrints the percentage next to the label.
variant"default" | "success" | "warning" | "destructive""default"Fill color.
size"sm" | "md""md"Bar height, 6 or 10 px.
classstring–Extra classes on the wrapper.

Accessibility

  • The wrapper has role="progressbar" with aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext, and its aria-label comes from the label prop.
  • A warning or destructive fill needs words nearby, such as "90% of storage used", because the fill color is not enough.
  • Updating the value in place makes screen readers announce the new percentage when the bar is focused or polled.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Progress" with `npx shadcn@latest add @haze/progress`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Progress from "@/components/haze/ui/progress.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/progress.md

  • Customize with real content

    Adapt the Haze progress ui for our product. Replace the demo values of these props with our real content: value, max, label, hideLabel, showValue, variant, size, class. Keep the layout, the heading level rules and these accessibility details: The wrapper has role="progressbar" with aria-valuemin, aria-valuemax, aria-valuenow and aria-valuetext, and its aria-label comes from the label prop. A warning or destructive fill needs words nearby, such as "90% of storage used", because the fill color is not enough. Updating the value in place makes screen readers announce the new percentage when the bar is focused or polled. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using progress, check it fits: use it when an upload, import or quota where you know how much is done; showing storage or plan usage, with warning or destructive fill when it runs high; a bar whose name is read out even when the label is visually hidden. Avoid it when work of unknown length; use spinner; named steps in a flow; use stepper. Alternatives: @haze/spinner, @haze/stepper, @haze/skeleton.

Dependencies

  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog