Skip to content

ProgressBar: Add more progress bar examples #6269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TylerJDev
Copy link
Member

Closes https://github.com/github/primer/issues/5314

Adds more progress bar examples for the ProgressBar component.

Changelog

New

  • Add additional progress bar examples

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@Copilot Copilot AI review requested due to automatic review settings July 2, 2025 13:36
@TylerJDev TylerJDev requested a review from a team as a code owner July 2, 2025 13:36
@TylerJDev TylerJDev requested a review from pksjce July 2, 2025 13:36
Copy link

changeset-bot bot commented Jul 2, 2025

⚠️ No Changeset found

Latest commit: a92a884

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@TylerJDev TylerJDev added the skip changeset This change does not need a changelog label Jul 2, 2025
@github-actions github-actions bot added the staff Author is a staff member label Jul 2, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds two new Storybook examples for the ProgressBar component: one that shows a visible text label next to the bar, and another demonstrating a segmented progress bar with a legend.

  • Introduces a WithVisibleTextValue story that pairs the bar with a text percentage.
  • Introduces a MultipleSegments story showing three colored segments and a labeled legend.

return (
<>
<ProgressBar progress={50} aria-label="Loading example" />
<p style={{color: 'var(--fgColor-muted)', font: 'var(--text-body-shorthand-medium)'}}>50% completed</p>
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using the Primer React Text component instead of a raw

with inline styles to maintain consistent typography and theming.

Copilot uses AI. Check for mistakes.

<ProgressBar aria-valuenow={50}>
<ProgressBar.Item
progress={30}
style={{backgroundColor: 'var(--bgColor-success-emphasis)'}}
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Use the sx prop or the ProgressBar.Item bg prop with theme tokens instead of applying inline style with CSS variables, ensuring consistency with the design system theming.

Copilot uses AI. Check for mistakes.

export const MultipleSegments = () => {
return (
<>
<ProgressBar aria-valuenow={50}>
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parent ProgressBar should include aria-valuemin and aria-valuemax (e.g., 0 and 100) to provide a complete accessible progress bar specification.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

github-actions bot commented Jul 2, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.42 KB (0%)
packages/react/dist/browser.umd.js 92.6 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changeset This change does not need a changelog staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants