@react-md/menu
Version:
Create menus that auto-position themselves within the viewport and adhere to the accessibility guidelines
18 lines (17 loc) • 730 B
TypeScript
/// <reference types="react" />
interface MenuKeyDownOptions {
menu: HTMLDivElement | null;
horizontal: boolean;
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
onRequestClose: () => void;
defaultFocus: string;
portalled: boolean;
}
/**
* This hook allows for the keyboard movement within a menu. It'll make sure
* that the arrow keys and typing letters can correctly focus menu items. In
* addition, it'll automatically swap to the left and right arrow keys if the
* menu is displayed horizontally.
*/
export declare function useMenuKeyDown({ menu, onKeyDown, onRequestClose, portalled, horizontal, defaultFocus, }: MenuKeyDownOptions): React.KeyboardEventHandler<HTMLDivElement>;
export {};