Menu
Organize related actions into items, groups, and submenus.
Usage guide
#Provide commands or a context menu for a specific target. Use Navigation for app-wide navigation.
Command groups
Group related items with menu-group and give each item a value.
Nested commands
Use menu-sub for nested commands. Use checkable to display selection state.
Examples
#Feature examples
#Choose a feature from 14 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-menu>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Show the action menu. | |
boolean | false | Select multiple items using checkboxes. | |
'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'bottomLeft' | Corner used to align the menu with its trigger. | |
'click' | 'hover' | 'contextmenu' | 'hover' | User action that opens the list or popup. | |
'left' | 'right' | 'right' | Direction in which the submenu expands. | |
boolean | false | Block user interaction and keyboard focus. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<boolean> | Emitted when the list opens. | |
CustomEvent<any> | Read the result from the event's detail. | |
CustomEvent<any> | Read the result from the event's detail. |
Methods
| Method | Returns | Description |
|---|---|---|
Promise<void> | Expand the submenu. | |
Promise<void> | Close the item. | |
Promise<void> | Toggle the current expansion state. | |
Promise<void> | Close the open panel. | |
Promise<number | null> | Returns the trigger element's measured width, or `null` when the menu has no DOM trigger (e.g. inside a dropdown wrapper) or the trigger is not currently rendered. Used by `<sy-menu-item loading>` as the fallback width when there are no non-loading siblings to inherit sizing from. | |
Promise<void> | Close the menu after a delay. | |
Promise<void> | Make every menu item selectable. | |
Promise<void> | Clear the menu item's selection indicator. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |
<sy-menu-item>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Block user interaction and keyboard focus. | |
string | '' | Current value or item identifier. | |
boolean | false | Selected or checked state. | |
boolean | false | Allow an item selection indicator. | |
boolean | false | Show a checkbox before the item. | |
boolean | false | Indicate that processing is in progress. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<{ value: string; label: string }> | Read the result from the event's detail. | |
CustomEvent<{ value: string; label: string; checked: boolean }> | Read the result from the event's detail. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |
<sy-menu-sub>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Block user interaction and keyboard focus. | |
boolean | false | Show the submenu. | |
string | '' | Title that opens the submenu. | |
'click' | 'hover' | 'hover' | User action that opens the list or popup. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |
<sy-menu-group>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
string | '' | Title of an action group. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |