GitHub

Progress

Progress bar indicator

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { Progress } from "@corew500/ui/progress"

<Progress>Content</Progress>

CMS Integration

CMSPayload CMS Integration
This component supports CMS-driven content via @corew500/cms-payload.
Loading...

API Reference

Props

PropTypeDefaultDescription
aria-valuetextstringA string value that provides a user-friendly name for `aria-valuenow`, the current value of the meter.
formatNumberFormatOptionsOptions to format the value.
getAriaValueText(formattedValue: string, value: number) => stringAccepts a function which returns a string value that provides a human-readable text alternative for the current value of the progress bar.
localeenumThe locale used by `Intl.NumberFormat` when formatting the value. Defaults to the user's runtime locale.
maxnumber100The maximum value.
minnumber0The minimum value.
value*numbernullThe current value. The component is indeterminate when value is `null`.
styleenumStyle applied to the element, or a function that returns a style object based on the component’s state.
classNameenumCSS class applied to the element, or a function that returns a class based on the component’s state.
renderenumAllows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

Accessibility

Screen Readers

  • - Uses `role="progressbar"` automatically
  • Sets `aria-valuenow`, `aria-valuemin`, `aria-valuemax`
  • Indeterminate state (value=null) sets `aria-busy="true"`
  • ProgressLabel is associated with the progress bar via ARIA
  • Screen readers announce progress updates

Localization

Translatable Content

  • - ProgressLabel children should be pre-translated

Locale-Specific Formatting

  • ProgressValue format can be customized via `format` function