Menu

Organize related actions into items, groups, and submenus.

Live preview
Interact with the component to see results here.
View code
HTML
<div style="display:inline-flex;align-self:center;margin:70px 0">
  <sy-button>Action menu<sy-menu
      trigger="click"
      position="bottomLeft"
      direction="right"
      id="sample"
    >
      <sy-menu-item value="edit">Edit</sy-menu-item>
      <sy-menu-item value="copy">Duplicate</sy-menu-item>
      <sy-menu-item value="archive" disabled>Archive</sy-menu-item>
    </sy-menu>
  </sy-button>
</div>

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.

Feature examples

#

Choose a feature from 14 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Menu Group / Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Menu Item / Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Checkable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Direction

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Item Loading

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Open

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Position

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Trigger

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Events · Item Checked

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · Item Selected

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · Opened

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

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 / PropertyTypeDefaultDescription
booleanfalseShow the action menu.
booleanfalseSelect 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.
booleanfalseBlock user interaction and keyboard focus.

Events

EventDetailDescription
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

MethodReturnsDescription
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

SlotDescription
Component body or child items.

<sy-menu-item>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalseBlock user interaction and keyboard focus.
string''Current value or item identifier.
booleanfalseSelected or checked state.
booleanfalseAllow an item selection indicator.
booleanfalseShow a checkbox before the item.
booleanfalseIndicate that processing is in progress.

Events

EventDetailDescription
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

SlotDescription
Component body or child items.

<sy-menu-sub>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalseBlock user interaction and keyboard focus.
booleanfalseShow the submenu.
string''Title that opens the submenu.
'click' | 'hover''hover'User action that opens the list or popup.

Slots

SlotDescription
Component body or child items.

<sy-menu-group>

Properties

Attribute / PropertyTypeDefaultDescription
string''Title of an action group.

Slots

SlotDescription
Component body or child items.