base-ui
base-ui copied to clipboard
[menu] Add `data-label` attribute to menu items
Feature request
Summary
It could be useful for different reasons to add a data-label attribute to the element that Menu.Item (or Menu.CheckboxItem or Menu.RadioItem) renders:
- Easily inspect how Base UI converts
childreninto a string label (whenlabelis not set), e.g. for debugging purposes. - Write custom search/filtering functionality in the menu (this is what I'm trying to do).
- Maybe even style a specific menu item from an ancestor that doesn't control the rendering of individual items (though it would be a fragile selector).
Examples in other libraries
N/A
Motivation
See above. Thank you!