Interface HeadlessMenuItemProps<T>

Props of the useMenuItem hook.

interface HeadlessMenuItemProps<T> {
    expandDelay?: number;
    hasSubmenu?: boolean;
    id?: string;
    isDisabled?: boolean;
    onAction?: ((value: T) => void);
    value?: T;
}

Type Parameters

  • T

    A value that is passed to onAction handler.

Properties

expandDelay?: number

A delay in milliseconds after which a submenu is expanded.

200
hasSubmenu?: boolean

If true then a menu item is expanded if a user presses ArrowRight or ArrowLeft to expand or collapse the submenu.

An expanded menu item with a submenu is considered expanded.

onAction is ignored for menu items that have a submenu.

false
id?: string

An ID that uniquely identifies a menu item. If omitted a fallback ID is dynamically created.

isDisabled?: boolean

If true then menu item is disabled.

false
onAction?: ((value: T) => void)

A handler that is called when user presses a menu item.

value?: T

A value that is passed to onAction handler.

MMNEPVFCICPMFPCPTTAAATR