Skip to content

HyMenubarItem

A single top-level entry in an hy-menubar. Renders a trigger button (label from the label prop or the default slot) and owns one nested hy-menu provided via the menu slot.

When the parent menubar is in hover-tracking mode (another menubar item is already open), hovering this item switches the open menu to this one.

The nested hy-menu emits show/hide NON-bubbling, so this item listens directly on the menu element (target phase) rather than via the <slot name="menu"> — the menu is the single source of truth for menu visibility. This item then re-emits show/hide BUBBLING, which is the menubar coordination channel (hy-menubar delegates by target). See .claude/rules/events.md.

Events

  • show - { source } — bubbling; relayed from the nested menu.
  • hide - { source } — bubbling; relayed from the nested menu.

Slots

  • default - The trigger label (falls back to label prop).
  • menu - The nested hy-menu.

Methods

focus()

Focus the trigger button.

Built with Lit. Documented with VitePress.