-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[material-ui][BottomNavigationAction] Add slots and slotProps #45776
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
Conversation
Netlify deploy previewhttps://deploy-preview-45776--material-ui.netlify.app/ BottomNavigationAction: parsed: +2.35% , gzip: +2.16% Bundle size reportDetails of bundle changes (Toolpad) |
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 support for slots and slotProps for the BottomNavigationAction component, allowing customization of its internal structure. Key changes include:
- Introducing a CustomButtonBase for testing slot behavior.
- Updating BottomNavigationAction to use the useSlot utility for managing root and label slots.
- Extending prop types to include new slots and slotProps definitions.
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.test.js | Adds a custom button for slot testing and passes custom slots to the conformance tests. |
packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.js | Integrates the useSlot utility to support slot-based customization and adds corresponding prop types. |
Files not reviewed (2)
- docs/pages/material-ui/api/bottom-navigation-action.json: Language not supported
- docs/translations/api-docs/bottom-navigation-action/bottom-navigation-action.json: Language not supported
Comments suppressed due to low confidence (1)
packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.test.js:27
- [nitpick] Consider adding tests that explicitly validate the behavior of slotProps for both root and label slots to ensure the expected props are forwarded correctly.
slots: {
}; | ||
|
||
const [RootSlot, rootProps] = useSlot('root', { | ||
elementType: BottomNavigationActionRoot, |
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.
elementType: BottomNavigationActionRoot, | |
shouldForwardComponentProp: true, | |
elementType: BottomNavigationActionRoot, |
The BottomNavigationActionRoot
comes from a ButtonBase
.
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.
One small request
Cherry-pick PRs will be created targeting branches: v6.x |
Uh oh!
There was an error while loading. Please reload this page.