@react-md/menu
Version:
Create menus that auto-position themselves within the viewport and adhere to the accessibility guidelines
33 lines (32 loc) • 1.4 kB
TypeScript
import type { HTMLAttributes, ReactElement, ReactNode, Ref } from "react";
import type { BaseSheetProps } from "@react-md/sheet";
import type { KeyboardFocusHookOptions, LabelRequiredForA11y } from "@react-md/utils";
import type { MenuListProps, MenuOrientationProps } from "./types";
/** @remarks \@since 5.0.0 */
export interface MenuSheetProps extends BaseSheetProps, KeyboardFocusHookOptions<HTMLDivElement>, MenuOrientationProps, MenuListProps {
/** {@inheritDoc MenuConfiguration.sheetHeader} */
header?: ReactNode;
/** {@inheritDoc MenuConfiguration.sheetFooter} */
footer?: ReactNode;
/**
* The `Menu`s children.
*/
children: ReactNode;
/**
* This should be the `menuRef` returned by the `useMenu` hook so that the
* menu can be focused on mount.
*/
menuRef: Ref<HTMLDivElement>;
/**
* Any additional props that should be passed to the `Menu` component.
*/
menuProps?: HTMLAttributes<HTMLDivElement>;
}
/**
* Implements a `Menu` using the `Sheet` component that probably shouldn't
* really be used externally.
*
* @remarks \@since 5.0.0
* @internal
*/
export declare function MenuSheet({ id, children, header, footer, horizontal, menuRef, menuProps, listStyle, listClassName, listProps, position, verticalSize, onClick, overlayProps, onRequestClose, ...props }: LabelRequiredForA11y<MenuSheetProps>): ReactElement;