An item in an orb-menu or orb-menubar. Its content is the label.
<orb-mi> is an item in an <orb-menu> or an <orb-menubar>. Its content is the label. See the menu docs for checkbox and radio items, submenus, the single and multi modes, and search. In those modes, items are options, and type is ignored. Set hidden to remove an item from the list, and from keyboard navigation and search.
Plain item
With an icon
⌘S
Checkbox item
Disabled item
Danger item
<orb-menu label="Example" style="max-width: 16rem;">
<orb-mi value="plain">Plain item</orb-mi>
<orb-mi value="icon">
<iconify-icon icon="mdi:star" slot="icon"></iconify-icon>
With an icon
<kbd slot="details">⌘S</kbd>
</orb-mi>
<orb-mi type="checkbox" checked>Checkbox item</orb-mi>
<orb-mi disabled>Disabled item</orb-mi>
<orb-mi variant="danger">Danger item</orb-mi>
</orb-menu>
Manual test:
- Every label lines up, because the menu has a checkable item.
- Hovering an item highlights it. Hovering the disabled item doesn’t.
- Click Checkbox item. Its checkmark toggles.
| Description |
Whether a checkbox or radio item is checked. In single and multi menus, whether the option is selected. |
| Attribute |
checked |
| Type |
boolean |
| Default |
false |
| Description |
Keeps the item focusable but stops it from being chosen |
| Attribute |
disabled |
| Type |
boolean |
| Default |
false |
| Description |
checkbox items toggle when chosen and keep the menu open. Choosing a radio item checks it and unchecks the other radio items with the same parent. Ignored in single and multi menus, where every item is a radio or checkbox item. |
| Attribute |
type |
| Type |
"checkbox" | "normal" | "radio" |
| Default |
"normal" |
| Description |
Identifies the item in orbSelect |
| Attribute |
value |
| Type |
string |
| Default |
undefined |
| Description |
danger colors the item for destructive actions, such as Delete |
| Attribute |
variant |
| Type |
"danger" |
| Default |
undefined |
| Slot |
Description |
|
The label |
"details" |
Extra text after the label, such as a keyboard shortcut |
"icon" |
An icon before the label |
| Part |
Description |
"checkmark" |
The checkmark shown when a checkbox or radio item is checked |
"details" |
The wrapper around the details slot |
"label" |
The wrapper around the label |
"submenu-icon" |
The arrow shown on items that open a submenu |
| Name |
Description |
--highlight |
Background of a hovered, focused, or open item |
graph TD;
orb-rich-text --> orb-mi
style orb-mi fill:#f9f,stroke:#333,stroke-width:4px