-
Notifications
You must be signed in to change notification settings - Fork 620
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
base: main
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this 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> |
There was a problem hiding this comment.
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)'}} |
There was a problem hiding this comment.
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}> |
There was a problem hiding this comment.
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.
size-limit report 📦
|
Closes https://github.com/github/primer/issues/5314
Adds more progress bar examples for the
ProgressBar
component.Changelog
New
Rollout strategy
Testing & Reviewing
Merge checklist