primereact
Version:
PrimeReact is an open source UI library for React featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with Prime
103 lines (100 loc) • 3.18 kB
TypeScript
/**
*
* Menu is a navigation/command component that supports dynamic and static positioning.
*
* [Live Demo](https://www.primereact.org/menu/)
*
* @module menu
*
*/
import * as React from 'react';
import { CSSTransitionProps } from '../csstransition';
import { MenuItem } from '../menuitem';
/**
* Defines valid properties in Menu component. In addition to these, all properties of HTMLDivElement can be used in this component.
* @group Properties
*/
export interface MenuProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* Defines if menu would displayed as a popup.
* @defaultValue false
*/
popup?: boolean | undefined;
/**
* Whether to automatically manage layering.
* @defaultValue true
*/
autoZIndex?: boolean | undefined;
/**
* Base zIndex value to use in layering.
* @defaultValue 0
*/
baseZIndex?: number | undefined;
/**
* DOM element instance where the overlay panel should be mounted. Valid values are any DOM Element and 'self'. The self value is used to render a component where it is located.
* @defaultValue document.body
*/
appendTo?: 'self' | HTMLElement | null | undefined;
/**
* The properties of CSSTransition can be customized, except for "nodeRef" and "in" properties.
* @type {CSSTransitionProps}
*/
transitionOptions?: CSSTransitionProps | undefined;
/**
* Callback to invoke when a popup menu is shown.
* @param {React.SyntheticEvent} event - Browser event.
*/
onShow?(event: React.SyntheticEvent): void;
/**
* Callback to invoke when a popup menu is hidden.
* @param {React.SyntheticEvent} event - Browser event.
*/
onHide?(event: React.SyntheticEvent): void;
/**
* Used to get the child elements of the component.
* @readonly
*/
children?: React.ReactNode | undefined;
}
/**
* **PrimeReact - Menu**
*
* _Menu is a navigation/command component that supports dynamic and static positioning._
*
* [Live Demo](https://www.primereact.org/menu/)
* --- ---
* 
*
* @group Component
*/
export declare class Menu extends React.Component<MenuProps, any> {
/**
* Toggles the visibility of the popup menu.
* @param {React.SyntheticEvent} event - Browser event.
*/
public toggle(event: React.SyntheticEvent): void;
/**
* Displays the popup menu.
* @param {React.SyntheticEvent} event - Browser event.
*/
public show(event: React.SyntheticEvent): void;
/**
* Hides the popup menu.
* @param {React.SyntheticEvent} event - Browser event.
*/
public hide(event: React.SyntheticEvent): void;
/**
* Used to get container element.
* @return {HTMLDivElement} Container element
*/
public getElement(): HTMLDivElement;
/**
* Used to get target element.
* @return {EventTarget} Target element
*/
public getTarget(): EventTarget | null;
}