ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

feat: add custom icon override for menu button

Open craigbehnke opened this issue 1 year ago • 0 comments

Prerequisites

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

  1. Having 2 buttons look identical
  2. 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;
}

link to existing code

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

craigbehnke avatar Oct 11 '24 23:10 craigbehnke