[menu] Add `data-label` attribute to menu items
Open
component: menu
type: enhancement
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 543
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 101
Description
# 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 `children` into a string label (when `label` is 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!
Contributor guide
Assessment
This issue has not been assessed yet.