ionic-framework
ionic-framework copied to clipboard
feat: add custom icon override for menu button
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
Add a configuration option for the IonMenuButton component to allow developers to override the icon used.
Describe the Use Case
Creating an override option would allow developers to more easily create an application with more than one menu/sidebar, without either
- Having 2 buttons look identical
- Needing to create a menu button component of their own
Describe Preferred Solution
Create a config option for the menu button that overrides the default icons.
So this:
const menuIcon = config.get('menuIcon', mode === 'ios' ? menuOutline : menuSharp);
would become something like this:
let menuIcon = config.get('menuIcon', mode === 'ios' ? menuOutline : menuSharp);
if (customIcon) {
menuIcon = customIcon;
}
Describe Alternatives
I could create a clone of the component that uses a custom icon, but this would cause the
Related Code
No response
Additional Information
No response