@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 } from "react";
import type { ListItemLinkProps, ListItemLinkWithComponentProps } from "@react-md/list";
/** @remarks \@since 2.0.0 */
export interface MenuItemLinkProps extends ListItemLinkProps {
/**
* The current role for the menu item. This will eventually be updated for
* some of the other `menuitem*` widgets.
*/
role?: "menuitem";
/**
* The tab index for the menu item. This should always stay at `-1`.
*/
tabIndex?: number;
/**
* Any additional props that should be provided to the `<li>` that wraps the
* link component. You probably won't ever need to use this.
*
* @remarks \@since 5.0.0
*/
liProps?: Readonly<HTMLAttributes<HTMLLIElement>>;
}
/** @remarks \@since 2.0.0 */
export declare type MenuItemLinkWithComponentProps = MenuItemLinkProps & ListItemLinkWithComponentProps;
/**
* This is a wrapper for the {@link ListItemLink} component that allows for the
* correct keyboard focus behavior within {@link Menu}s. Just like the
* {@link ListItemLink}, set a {@link ListItemLinkProps.component} prop to your
* custom `Link` if needed.
*
* @remarks \@since 2.0.0
*/
export declare const MenuItemLink: import("react").ForwardRefExoticComponent<(MenuItemLinkProps | Pick<MenuItemLinkWithComponentProps, string | number>) & import("react").RefAttributes<HTMLAnchorElement>>;