packages/web-components/src/menu-item/README.md
Menu list item options displayed in a MenuList component. They are invoked when users interact with a button, action, or other control.
<hr />Remaining work items
Link to Menu Item Design Spec in Figma
<hr />Fluent WC3 Menu extends from the FAST Menu FAST Menu Item and is intended to be as close to the Fluent UI React 9 Menu implementation as possible. However, due to the nature of web components there will not be 100% parity between the two.
role - an enum representing the menu items' role
menuitemmenuitemcheckboxmenuitemradiodisabled - the menu item is disabledchecked - sets the checked value for menuitemcheckbox or menuitemradio itemsclick (event) - event for when the item has been clicked or invoked via keyboardchange (event) - event for when the item has been clicked or invoked via keyboard, and will be prevented if the menu item is disabledexpanded-change (event) - event for when the item has been expanded or collapsedbefore - slot which precedes contentdefault - slot for the content (the default slot for the item)after - slot which comes after contentsubmenu - the slot used to generate a submenuradio-indicator - slot for radio item selection indicatorcheckbox-indicator - slot for the checkbox selection indicatorexpand-collapse-glyph - slot for the expand/collapse glyph for nested menusborderRadiusMediumcolorCompoundBrandForeground1HovercolorCompoundBrandForeground1PressedcolorNeutralBackground1colorNeutralBackground1HovercolorNeutralBackground1PressedcolorNeutralBackgroundDisabledcolorNeutralForeground2colorNeutralForeground2HovercolorNeutralForeground2PressedcolorNeutralForeground3colorNeutralForegroundDisabledcolorNeutralStrokeDisabledfontFamilyBasefontSizeBase200fontSizeBase300fontWeightRegularfontWeightSemiboldlineHeightBase200lineHeightBase300ARIA Attributes
| Attribute | Options | Description |
|---|---|---|
| aria-checked | boolean | |
| aria-disabled | boolean | indicates that the element is perceivable but disabled, so it is not editable or otherwise operable |
| role | menuitem | menuitemcheckbox | menuitemradio | an enum representing the menu items' role |
Due to the nature of Web Components there will not be 100% parity between component implementation in Fluent UI React v9 and Fluent Web Components v3.
Component, Slot, and Attribute Mapping
| Component, Slot, or Attribute | Fluent React v9 | Fluent Web Components v3 |
|---|---|---|
| Menu | <MenuList> | <fluent-menu> |
| Menu item | <MenuItem> | <fluent-menu-item> |
| Menu item with radio | <MenuItemRadio> | <fluent-menu-item role="menuitemcheckbox">.. |
| Menu item with checkbox | <MenuItemCheckbox> | <fluent-menu-item role="menuitemcheckbox">.. |
| Icons | <MenuItem icon={<MyIcon />}> | <slot name ="start">.. |
<slot name="end">.. | ||
| Menu group header | <MenuGroupHeader> | <fluent-menu-item class="header"> |
Additional Deltas
In order for icons to render with appropriate styles the icons attribute must be present on the Menu.