Progress
Basic Usage
Loading...
Installation
pnpm add @corew500/uiUsage
import { Progress } from "@corew500/ui/progress"
<Progress>Content</Progress>CMS Integration
Loading...
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| aria-valuetext | string | — | A string value that provides a user-friendly name for `aria-valuenow`, the current value of the meter. |
| format | NumberFormatOptions | — | Options to format the value. |
| getAriaValueText | (formattedValue: string, value: number) => string | — | Accepts a function which returns a string value that provides a human-readable text alternative for the current value of the progress bar. |
| locale | enum | — | The locale used by `Intl.NumberFormat` when formatting the value. Defaults to the user's runtime locale. |
| max | number | 100 | The maximum value. |
| min | number | 0 | The minimum value. |
| value* | number | null | The current value. The component is indeterminate when value is `null`. |
| style | enum | — | Style applied to the element, or a function that returns a style object based on the component’s state. |
| className | enum | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
| render | enum | — | Allows 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