-
Notifications
You must be signed in to change notification settings - Fork 648
feat(ButtonGroup): remove support for sx #6835
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
feat(ButtonGroup): remove support for sx #6835
Conversation
🦋 Changeset detectedLatest commit: 844f8b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 removes the deprecated sx prop from the ButtonGroup component as part of the ongoing migration away from the styled-components system to CSS modules. The change includes updating the component's TypeScript interface, replacing the internal BoxWithFallback wrapper with a polymorphic base component, and migrating existing sx usage in stories to standard CSS properties.
Key changes:
- Removes
sxprop support fromButtonGroupcomponent interface - Replaces
BoxWithFallbackwith polymorphic component pattern usingasprop - Updates development stories to use inline styles instead of
sxprop
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/react/src/ButtonGroup/ButtonGroup.tsx | Removes sx prop, replaces BoxWithFallback with polymorphic component pattern |
| packages/react/src/ButtonGroup/ButtonGroup.docs.json | Removes deprecated sx prop from component documentation |
| packages/react/src/ButtonGroup/ButtonGroup.dev.stories.tsx | Migrates sx usage to inline styles and removes SxProp story |
| .changeset/light-colts-burn.md | Adds changeset entry for major version bump |
| const ButtonGroup = React.forwardRef(function ButtonGroup( | ||
| {as: BaseComponent = 'div', children, className, role, ...rest}, |
Copilot
AI
Sep 10, 2025
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 as prop is destructured but not included in the ButtonGroupProps type definition. This creates a mismatch between the component's actual interface and its declared props type, which could confuse consumers and break TypeScript IntelliSense.
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/2668 |
|
🟢 ci completed with status |
|
👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks! |
Closes #6761
Changelog
New
Changed
Removed
sxfromButtonGroupRollout strategy
This component has no sx usage in github-ui and can be safely merged in ✅