EnhanceMenuOptions: {
    defaultValue?: string | null;
    onSelect?: (value: string, item: HTMLElement, checked?: boolean) => void;
    onValueChange?: (value: string | null) => void;
    orientation?: "horizontal" | "vertical";
    position?: boolean;
}

Options for enhanceMenu.

Type declaration

  • OptionaldefaultValue?: string | null

    Value of the submenu to open on enhance. Submenu values come from data-hl-value on each top-level trigger, defaulting to the index.

  • OptionalonSelect?: (value: string, item: HTMLElement, checked?: boolean) => void

    Called with the item's value when a leaf menu item is activated. For menuitemcheckbox/menuitemradio items, checked is the new state.

  • OptionalonValueChange?: (value: string | null) => void

    Called with the open top-level submenu's value (or null) after every change.

  • Optionalorientation?: "horizontal" | "vertical"

    Layout of the top-level menu. Defaults to horizontal (menubar).

  • Optionalposition?: boolean

    Run the JS positioning fallback when CSS anchor positioning is missing. Defaults to true.