question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can MenuItem be extended to take an icon prop?

See original GitHub issue

I’m currently having to compose the UI myself. It works, but it’s a little bit clunky.

Here’s a sandbox: https://codesandbox.io/s/chakra-js-starter-z0400

I’m thinking it’d be nice to reuse Button’s leftIcon and rightIcon prop names for this.

I think this idea could be used for the new Select component too (#38)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
segunadebayocommented, Oct 3, 2019

I see what you mean.

Allowing users to compose the content of MenuItem was intentional but I understand that having the icon prop will save some time.

I’ll consider adding that to the MenuItem component.

1reaction
segunadebayocommented, Dec 2, 2019

@aaronmcadam. I intend to add a MenuItemIcon component in the dev-ts branch

Read more comments on GitHub >

github_iconTop Results From Across the Web

MenuItem.Icon Property (System.Windows.Controls)
Gets or sets the icon that appears in a MenuItem. ... MenuItem.Icon Property ... Many Menu controls have more than just text in...
Read more >
Menu Item is not expanding default after applying property ...
I am working on diamond-react theme of primereact and I have customized the menu. I want to expand the menu item default or...
Read more >
MenuItem API - Material UI - MUI
Name Type Default autoFocus bool false children node classes object
Read more >
MenuItem - Mineral UI
A MenuItem can display an Icon at its start, end, or both. If both startIcon and variant props are provided, startIcon will be...
Read more >
Menu - Chakra UI
You can add icon to each MenuItem by passing the icon prop. To add a commands (or hotkeys) to menu items, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found