Skip to content

HyMenuItemRadio

A grouped, single-select row inside an hy-menu. Composition wrapper around hy-menu-item that adds checked state, a leading radio-dot glyph, and a change event.

Grouping

Siblings that share the same name form a radio group. The parent hy-menu listens for change, unchecks every other radio in the group, and re-emits an aggregated change event with { selectedValue, name, reason } — matching hy-radio-group's API.

Radios without a name work visually but do not participate in mutual exclusion or the menu-level change event. The hy-menu-group role="radiogroup" pattern is also honored when present.

Events

  • change - { checked, value, name, reason } when this radio toggles. Stops at the parent hy-menu, which re-emits an aggregated change.
  • select - Relayed from inner hy-menu-item.

Slots

  • default - Default label content when label prop is empty.
  • leading - Overrides the default radio-dot glyph.
  • trailing - Trailing indicator / shortcut hint.

Methods

focus()

Imperative focus — forwards to the inner hy-menu-item.

setTabIndex()

Called by parent hy-menu roving-tabindex logic. Forwards to the inner hy-menu-item and mirrors the tab-stop state on the host's reflected [active] attribute (focus trap discovery + CSS hook).

Built with Lit. Documented with VitePress.