Move selected icon position in MenuOptionGroup
See original GitHub issueFeature request
Is your feature request related to a problem? Please describe.
I want to be able to put the checkmark icon to the right of the option item
Describe the solution you’d like
We could add a iconPosition
prop like this
<MenuOptionGroup defaultValue="asc" title="Order" type="radio" iconPosition="right">
<MenuItemOption value="asc">Ascending</MenuItemOption>
<MenuItemOption value="desc">Descending</MenuItemOption>
</MenuOptionGroup>
or we could make the checkmark into its own component and we would use it like this
<MenuOptionGroup defaultValue="asc" title="Order" type="radio">
<MenuItemOption value="asc">Ascending<MenuItemOption.Checkmark/></MenuItemOption>
<MenuItemOption value="desc">Descending<MenuItemOption.Checkmark/></MenuItemOption>
</MenuOptionGroup>
or we could make a leftSelectedIcon
and rightSelectedIcon
prop
<MenuOptionGroup defaultValue="asc" title="Order" type="radio" rightSelectedIcon={<CheckmarkIcon/>}>
<MenuItemOption value="asc">Ascending</MenuItemOption>
<MenuItemOption value="desc">Descending</MenuItemOption>
</MenuOptionGroup>
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
android - How to increase icon position if item is selected in ...
What I am trying to accomplish is basically having the icon move up a little bit when the icon is selected and move...
Read more >Menu - Chakra UI
MenuItem : The trigger that handles menu selection. Must be a direct child of a MenuList . MenuGroup : A wrapper to group...
Read more >Menu - Purity UI Dashboard - Creative Tim
MenuItem : The trigger that handles menu selection. Must be a direct child of a MenuList . MenuGroup : A wrapper to group...
Read more >MOVE GALLERY WHEN I SELECT A ICON
There is a way to move a label and a gallery to move the X and Y? I like to remove this space...
Read more >Menu - Chakra UI
MenuItem : The trigger that handles menu selection. ... MenuOptionGroup : A wrapper for checkable menu items (radio and checkbox).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I think we should add this functionality. Shouldn’t be a huge change.
Sounds like a good idea - currently the right side is not used: https://github.com/chakra-ui/chakra-ui/blob/develop/packages/menu/src/menu.tsx#L271
I guess we can follow the example of
Button
and replaceicon
andiconSpacing
withleftIcon
andrightIcon
+ their corresponding spacing. The complexity would barely increase.Downside:
0.75rem
less width for contentMenuItemOption
Something like: