I'm rewriting a Next.js application to use Joy UI.
Joy UI offers a MenuButton component to open a menu. It behaves identically like a Button in terms of style. I would like to use a different component by Joy UI, but keep the same behavior.
In my case, I need one menu button to be an IconButton and another menu button to be a Chip.
I believe I did find a way to do this in an elegant way a while ago, but I can't remember it anymore. I was unable to find anything about it in the docs. I tried changing the component by using the component prop, but it didn't achieve anything. Is there a way to do this?
I figured it out.
componentis the correct prop to use, but it's the other way around.Instead of creating a
MenuButtonand passingChipto it, create aChipand passMenuButtonto it ascomponent. Example: