|
| 1 | +# Progress |
| 2 | + |
| 3 | +A progress bar gives the user a visual representation of their completion status of an ongoing process or task. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```html |
| 8 | +<pf-v6-progress value="33" description="Title"></pf-v6-progress> |
| 9 | + |
| 10 | +<script type="module"> |
| 11 | + import '@patternfly/elements/pf-v6-progress/pf-v6-progress.js'; |
| 12 | +</script> |
| 13 | +``` |
| 14 | + |
| 15 | +With variant and measure location: |
| 16 | + |
| 17 | +```html |
| 18 | +<pf-v6-progress value="100" |
| 19 | + description="Upload complete" |
| 20 | + variant="success" |
| 21 | + measure-location="outside"></pf-v6-progress> |
| 22 | +``` |
| 23 | + |
| 24 | +With helper text: |
| 25 | + |
| 26 | +```html |
| 27 | +<pf-v6-progress value="33" description="Uploading"> |
| 28 | + <span slot="helper-text">Uploading 3 of 9 files</span> |
| 29 | +</pf-v6-progress> |
| 30 | +``` |
| 31 | + |
| 32 | +## Divergences from React `Progress` |
| 33 | + |
| 34 | +### Not implemented |
| 35 | + |
| 36 | +| React prop | Notes | |
| 37 | +|---|---| |
| 38 | +| `label` | Use `value-text` for custom measure text. Rich content (ReactNode) not supported. | |
| 39 | +| `tooltipPosition` | Not implemented. | |
| 40 | + |
| 41 | +### Changed API |
| 42 | + |
| 43 | +| React prop | Web component | Difference | |
| 44 | +|---|---|---| |
| 45 | +| `title` | `description` attribute | Visible title text above the bar. Renamed to avoid shadowing the native HTML `title` attribute. | |
| 46 | +| `isTitleTruncated` | `truncated` attribute | Boolean. Truncates `description` with CSS ellipsis. | |
| 47 | +| `measureLocation` `"top"` | Default (no attribute) | React's `"top"` is the default; omitting `measure-location` produces the same layout. | |
| 48 | +| `measureLocation` | `measure-location` attribute | Singleline layout derived automatically when no `description` is set. | |
| 49 | +| `size` `"md"` | Default (no attribute) | React's `"md"` is the default size; omitting `size` produces the same result. | |
| 50 | +| `helperText` | `helper-text` slot | Slot instead of prop. Slotted elements are automatically wired to `aria-describedby` via ElementInternals. | |
| 51 | +| `aria-label` | `accessible-label` attribute | Screen reader name set via ElementInternals. Falls back to `description`, then `"Progress status"`. | |
| 52 | +| `aria-labelledby` | Native `aria-labelledby` on host | Use the native attribute directly on the host element -- the host has `role="progressbar"` so standard ARIA attributes work. | |
| 53 | +| `aria-describedby` | `helper-text` slot | Slot content is automatically associated via `ariaDescribedByElements`. For external descriptions, use native `aria-describedby` on the host. | |
| 54 | +| `hideStatusIcon` | `hide-status-icon` attribute | Boolean. Hides the variant status icon while keeping variant coloring. | |
| 55 | + |
| 56 | +### Added |
| 57 | + |
| 58 | +| Web component API | Notes | |
| 59 | +|---|---| |
| 60 | +| `helper-text` slot | Rich content below the bar, auto-wired to `aria-describedby`. | |
0 commit comments